| 1. |
Solve : Copy Doc files from Documents and Settings folder !!!? |
|
Answer» Hello agian, I believe this will work: Hello John, i did as you did and gave the path right except i wanted the doc files in c:\Document and Settings\My Documents\ and c:\Document and Settings\My Documents\downloads to copied on f: it didn't work. Sadly, however i came up with a solution and gave this command: Code: [Select]@ECHO off xcopy /y "%userprofile%\Desktop\*.doc" f: xcopy /y "%userprofile%\My Documents\*.doc" f: xcopy /y "%userprofile%\My Documents\Downloads\*.doc" f:This worked like a charm every doc file containing in My document and Download folder as well as the Desktop got copied in F: To go a step further i went and gave the same command and replaced the *.doc with *.txt in another line and it copied the txt file as well. Code: [Select]@echo off xcopy /y "%userprofile%\Desktop\*.doc" f: xcopy /y "%userprofile%\My Documents\*.doc" f: xcopy /y "%userprofile%\My Documents\Downloads\*.doc" f: xcopy /y "%userprofile%\Desktop\*.txt" f: xcopy /y "%userprofile%\My Documents\*.txt" f: xcopy /y "%userprofile%\My Documents\Downloads\*.txt" f: Anyways John thanks for trying to HELP, i just saw the environment variable that was set for Document and Settings folder along with the user. From their it was all good. p.s: PATTING myself. Good work. You can use a for in do loop to copy multiple filespecs, like so: Code: [Select]@echo off for %%a in ( doc txt swf ini avi mp3 ) do ( xcopy /y "%userprofile%\Desktop\*.%%a" f: xcopy /y "%userprofile%\My Documents\*.%%a" f: xcopy /y "%userprofile%\My Documents\Downloads\*.%%a" f: ) |
|