I have a small batch file that uses robocopy to backup a folder. The intended action is for it to copy C:/users/public/ into D:/Backups/YYYY-MM-DDTHHMM/
At present, it copies the files into a folder, however the folder name appears in Windows Explorer as 'Public' instead of the requested file name. Stranger still, if I dir the folder from cmd (or check the security tab of it's properties) it appears as the name I desire!
Batch file:
@ECHO OFF
for /f "skip=1" %%x in ('wmic os get localdatetime') do if not defined MyDate set MyDate=%%x
set today=%MyDate:~0,4%-%MyDate:~4,2%-%MyDate:~6,2%T%MyDate:~8,2%%MyDate:~10,2%
robocopy C:/users/Public D:/Backups/%today%
Changing the robocopy line to:
Excludes the windows appearance file and completes the job perfectly. I can't answer my own question for 8 hours but I'll add the answer then.
– Garth Oates Apr 22 '14 at 12:36