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!
@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%