Any way when copying files via Xcopy (via batch) to output the filenames of the files being copied - or better yet, the base folder and filename - rather than the whole directory path?
The batch uses %USERPROFILE%\Desktop which resolves to C:\Documents and Settings\Username\ and then Desktop. Then that's where the folder lives with the files and directories to be copied.
Of course when it copies across you see C:\Documents and Settings\Username\Desktop\TheFolder\SubFolder\filename.txt in the output window, which takes up 2 lines per copy and just looks terrible when you are trying to see where its up to.
All I want to see is SubFolder\filename.txt
Use cd /folder to change to the source folder (or one above it), and in the xcopy statement, don't include the entire path.
For example, instead of this...
xcopy c:\tmp\q\z\*.* c:\destfolder
...do this:
cd \tmp\q
xcopy z\*.* c:\destfolder
And to copy from the desktop:
cd %userprofile%
xcopy desktop\*.* c:\destfolder
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With