Want to write a script that add current date on file name and cut to another folder, but can execute on win 10 and server 2019 but not win 11 and server 2022. How can I solve it?
cd E:\FGT_temp
E:
@set name=%date:10,4%%date:4,2%%date:~7,2%
ren Richlands.conf "%date:-4,4%%date:-7,2%%date:-10,2%Richlands.conf"
ren Manurewa.conf "Manurewa_%date:-4,4%%date:-7,2%%date:-10,2%.conf"
md "E:\FGT_backup%name%"
xcopy /s "E:\FGT_temp" "E:\FGT_backup%name%"
del /s /Q E:\FGT_temp