repacker Posted January 19, 2011 Report post Posted January 19, 2011 Hi, I'm searching for a script to delete all files and folders from drive D: but at the same time I'd like to to exclude a few folders and files! A was looking at Robocopy. Here is my testscript: *************** mkdir C:\DELETE robocopy "D:\" "D:\DELETE" /E /MOV /NP /XD "Dir 1" "Dir 20 00" "Dir3" /XF "File 1.dll" "File 2 0 .txt" /R:10 /W:30 rmdir "c:\DELETE" /s /Q ************* It creates a directory > copies everything (except the excluded folders and files) to that directory and than it deletes the directory....but It gives back this message: ERROR: Invalid Parameter #4 : "00 Dir3 /XF File" What is the right command line string? Best regards Quote Share this post Link to post Share on other sites More sharing options...
0 Eswar Koneti Posted January 19, 2011 Report post Posted January 19, 2011 Hi, I'm searching for a script to delete all files and folders from drive D: but at the same time I'd like to to exclude a few folders and files! A was looking at Robocopy. Here is my testscript: *************** mkdir C:\DELETE robocopy "D:\" "D:\DELETE" /E /MOV /NP /XD "Dir 1" "Dir 20 00" "Dir3" /XF "File 1.dll" "File 2 0 .txt" /R:10 /W:30 rmdir "c:\DELETE" /s /Q ************* It creates a directory > copies everything (except the excluded folders and files) to that directory and than it deletes the directory....but It gives back this message: ERROR: Invalid Parameter #4 : "00 Dir3 /XF File" What is the right command line string? Best regards can you provide the full path for the file 1.dll after /XF ? something like /XF C:\eskonr\test.txt OR /XF C:\eskonr\test\test.txt Quote Share this post Link to post Share on other sites More sharing options...
0 repacker Posted January 24, 2011 Report post Posted January 24, 2011 can you provide the full path for the file 1.dll after /XF ? something like /XF C:\eskonr\test.txt OR /XF C:\eskonr\test\test.txt Hi Eswar, Thank you for the reply, I'd tried the full path option, with and without quotes but that doesn't work. I made one step; I decided to test with only one directory and one file and found that the syntasource directory was not correct mkdir C:\DELETE robocopy "D:\" "D:\DELETE" /E /MOV /NP /XD "Dir 1" "Dir 20 00" "Dir3" /XF "File 1.dll" "File 2 0 .txt" /R:10 /W:30 rmdir "c:\DELETE" /s /Q robocopy "D:\" must be robocopy "D:", now its moving the directories and files to the DELETE directorie. but the script stops because it cannot copy the hidden 'System Volume Informatuion" directory. Quote Share this post Link to post Share on other sites More sharing options...
Hi,
I'm searching for a script to delete all files and folders from drive D: but at the same time I'd like to to exclude a few folders and files!
A was looking at Robocopy. Here is my testscript:
***************
mkdir C:\DELETE
robocopy "D:\" "D:\DELETE" /E /MOV /NP /XD "Dir 1" "Dir 20 00" "Dir3" /XF "File 1.dll" "File 2 0 .txt" /R:10 /W:30
rmdir "c:\DELETE" /s /Q
*************
It creates a directory > copies everything (except the excluded folders and files) to that directory and than it deletes the directory....but
It gives back this message:
ERROR: Invalid Parameter #4 : "00 Dir3 /XF File"
What is the right command line string?
Best regards
Share this post
Link to post
Share on other sites