+ Post New Thread
Results 1 to 2 of 2
Windows Thread, Windows 2003 date command and day name in Technical; Hello I'm making a batch script to do backups on a Windows 2003 server, and a key part of it ...
  1. #1

    webman's Avatar
    Join Date
    Nov 2005
    Location
    North East England
    Posts
    8,412
    Thank Post
    642
    Thanked 963 Times in 663 Posts
    Blog Entries
    2
    Rep Power
    326

    Unhappy Windows 2003 date command and day name

    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.

    Code:
    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!

  2. #2

    SYNACK's Avatar
    Join Date
    Oct 2007
    Posts
    11,205
    Thank Post
    876
    Thanked 2,729 Times in 2,308 Posts
    Blog Entries
    11
    Rep Power
    782
    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
    Code:
    wscript.echo weekdayname(Weekday(Now()))
    Last edited by SYNACK; 19th November 2008 at 01:31 PM.

SHARE:
+ Post New Thread

Similar Threads

  1. Windows XP SP3 change to Date/Time format
    By itwasntme in forum Windows
    Replies: 7
    Last Post: 11th July 2008, 01:18 PM
  2. Replies: 0
    Last Post: 5th February 2008, 04:24 PM
  3. How to find Command Bar ID's in Office 2003
    By originofsymmetry in forum How do you do....it?
    Replies: 1
    Last Post: 15th July 2007, 10:41 PM
  4. Replies: 5
    Last Post: 30th January 2007, 08:21 AM
  5. Linux SuperUser command, but for Windows
    By MrLudwig in forum Windows
    Replies: 25
    Last Post: 18th May 2006, 04:16 PM

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •