I am unable to get the time stamp in file name by using batch script in Windows Server 2022 Datacenter 64-bit Version 21H2(Build 20348.1487). Could you please help me on this.
Batch Script
SET dataauditfilename=myAuditReport
rem Section to rename the file
Set Timestamp=%date:~4,2%_%date:~7,2%_%date:~10,4%_%time:~1,1%%time:~3,2%%
ren "%dataauditfilename%.CSV" "%dataauditfilename%_%Timestamp%.CSV"
The above batch script works in Windows 11 but not in Windows server 2022 Datacenter 64-bit Version 21H2(Build 20348.1487).