Zxian Posted October 5, 2005 Posted October 5, 2005 I've got another small batch file job that I'm hoping people can help me out with.I'm trying to create a batch file that will take all the non-links from the desktop and move them to a folder, including directories.This is what I've got so far...@echo off&setlocal enableextensionsset src=C:\Documents and Settings\Administrator\Desktopset dest=C:\Documents and Settings\Administrator\My Documents\Desktoppushd %src%for /f "tokens=*" %%a in ('dir/b/a') do ( IF /I %%~xa NEQ .lnk ( robocopy %%a %dest% /S /MOVE>nul ))popd&endlocal&goto :eofWhen I run this... nothing happens... Any ideas/suggestions would be appreciated.
Yzöwl Posted October 6, 2005 Posted October 6, 2005 (edited) You can just use the exclude option in robocopy, for example:@echo offset src=C:\Documents and Settings\Administrator\Desktopset dest=C:\Documents and Settings\Administrator\My Documents\Desktoprobocopy "%src%" "%dest%" /copyall /mov /xf *.lnk /r:30 /w:10>nulgoto :eof<Edit>Replaced my test dirs with your %src% and %dest%</Edit> Edited October 6, 2005 by Yzöwl
Zxian Posted October 6, 2005 Author Posted October 6, 2005 That would probably work... I'll test it out tomorrow. Thanks!
Zxian Posted October 6, 2005 Author Posted October 6, 2005 Yup... it's included by default in XP, but not in 2K.
prathapml Posted October 6, 2005 Posted October 6, 2005 what's included in XP? 'robocopy' is not recognized as an internal or external command,operable program or batch file.
Zxian Posted October 6, 2005 Author Posted October 6, 2005 what's included in XP? 'robocopy' is not recognized as an internal or external command,operable program or batch file.Wierd... I've got it on my laptop and I haven't installed any extra packs... Maybe it's XP Pro?
prathapml Posted October 6, 2005 Posted October 6, 2005 Maybe it's XP Pro? Thats what i have!Pro, SP2
gunsmokingman Posted October 7, 2005 Posted October 7, 2005 (edited) Wrong Post My Mistake Edited October 7, 2005 by gunsmokingman
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now