I have a batch script like below, it was working in our old server(2008), but when I moved it to new one it cannot update %d%:
rem @echo off
@set path=c:\test;%path%
@set d=%date:~-4,4%%date:~4,2%%date:~-7,2%
@set d=%d: =_%
@set t=%time:~0,2%%time:~3,2%%time:~6,2% @set t=%t: =0%
Rem Generate PGP encrypted file
@echo Starting PGP... >> c:\apps\ftpLogs\test.log
gpg2 --batch --yes -r testkey --output c:\test\foo\test_%d%.pgp --encrypt c:\test\foo\test_%d%.txt >> c:\apps\ftpLogs\test.log
When I am changing the %d% to today' date, the pgp and every thing works well , but in case of using %d% it's bypassing these lines. Any help will be much appreciated