Hi,
It maybe case sensitive (is shouldn't, but just an idea) and you can try to simplify the bat and see where it breaks.
Here is an example that should work:
And you need to be admin.
Hope this helps!
This browser is no longer supported.
Upgrade to Microsoft Edge to take advantage of the latest features, security updates, and technical support.
Hello,
Writing a simple batch file and don't know how to store the current date and revert back to it later?
Something like:
Set DateString=%Date%
...
Date DateString
The system cannot accept the date entered.
sorry but didn't find a tag for command prompt/ batch scripting, but am sure it's so simple :)
Please advise :)
Hi,
It maybe case sensitive (is shouldn't, but just an idea) and you can try to simplify the bat and see where it breaks.
Here is an example that should work:
And you need to be admin.
Hope this helps!
set DateString=%date:~4%
echo %DateString%
I use this when I want to create a log file name with date and time.
echo "myapp.%date:~10,4%%date:~4,2%%date:~7,2%%time:~0,2%%time:~3,2%%time:~6,2%.log"