I'm making a batch script to do backups on a Windows 2003 server, and a key part of it is getting the day name (Mon, Tue, Wed etc) using the date /t command (as below). The script works perfectly on Windows 2000, but when ran on 2003, all I get is dd/mm/yyy - no day name.
Anyone know how/where to get the day name in 2003 please? Thankyou!Code:for /f "Tokens=1-4 Delims= " %%i in ('date /t') do set dayname=%%i
You could offload that task by making a VBScript that outputs the current day name and then alter your batch for loop so that it sources the information from the script rather than the date command.
You would need to use the /nologo switch with cscript when you run it though to get rid of all the cscript info that comes up pre run.
nice simple bit of script to:
Last edited by SYNACK; 19th November 2008 at 01:31 PM.
There are currently 1 users browsing this thread. (0 members and 1 guests)