I'm having a problem where I want to to add date and time to my plugins folder, but for some reason it keeps saying that:
The filename directory name or volume label syntax is incorrect.
The code is following (batch file is in the same folder as plugins folder is)
ren "plugins" "* %Date:/= % %TIME:~3,2%,%TIME:~0,2%*"
PAUSE
CMD window
C:\Users\Jakub Lapka\Desktop\BackUp>ren "plugins" "* 08.03.2020 51,16*"
The filename directory name or volume label syntax is incorrect.
Is there any way how can I rename this so I can use this bacth file for several folders without hardcoding the file names?
Edit: I know that I have switched the time positions for HH and MM. I'll fix this later.
for /d %f in (*) do ren %f "%f %Date:/= % %TIME:~3,2%,%TIME:~0,2%"
a shot once in the folder and see if that does the trick. If you are running from batch script and not command line then double the%
character and usefor /d %%f in (*) do ren %%f "%%f %Date:/= % %TIME:~3,2%,%TIME:~0,2%"
.