webman Posted November 19, 2008 Posted November 19, 2008 Hello 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. for /f "Tokens=1-4 Delims= " %%i in ('date /t') do set dayname=%%i Anyone know how/where to get the day name in 2003 please? Thankyou!
SYNACK Posted November 19, 2008 Posted November 19, 2008 (edited) 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. edit: nice simple bit of script to: day.vbs wscript.echo weekdayname(Weekday(Now())) Edited November 19, 2008 by SYNACK
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now