---------- cut -------------
REM Batch file to put month and day into environment variables
REM


FOR /f "tokens=1,2" %%X in ('date /t') DO SET TheDate=%%Y

FOR /f "delims=/ tokens=1,2,3" %%A in ("%TheDate%") DO SET Month=%%A
FOR /f "delims=/ tokens=1,2,3" %%A in ("%TheDate%") DO SET Day=%%B
ECHO Month=%Month%  Day=%Day%
---------- cut -------------

Learning VBScript to run WSH is a good investment of your time.  
http://msdn.microsoft.com/scripting/ is a good place to start.

_VT_VT_VT_VT_VT_VT_VT_VT_VT_VT_VT_VT_VT_VT_

Todd Pukanecz, MCSE, GCWN
Virginia Tech, Ag Human and Natural Resources IT
Blacksburg, Virginia

"The more complex the law, the greater the opportunity for scoundrels."
  --Robert A. Heinlein


> -----Original Message-----
> From: Duane Boudreau [mailto:[EMAIL PROTECTED]
> Sent: Thursday, June 26, 2003 10:44 AM
> To: NT 2000 Discussions
> Subject: Batch File Question
> 
> 
> Hi All,
> 
> Its a long time since I wrote a batch file so please bear with.
> 
> I'm trying to set a variable within a batch file to the system date,
> actually what I really need is the month and day, but I'm not 
> sure if that's
> possible.
> 
> I tried (with no success):
> 
> set var = date /t
> echo var
> 
> I'm using this batch file to run the command line winzip 
> utilities to go in
> and zip up about 2 GB of SQL Server backups.
> 
> Maybe I should be using WSH but I've never used it before. If 
> this isn't
> possible using a batch file can someone point me to a good 
> WSH refernce
> site?
> 
> Duane
> 
> 
> 
> ------
> You are subscribed as [EMAIL PROTECTED]
> Web Interface: 
> http://intm-dl.sparklist.com/cgi-bin/lyris.pl?enter=nt2000&tex
t_mode=&lang=english
To unsubscribe send a blank email to %%email.unsub%%

------
You are subscribed as [EMAIL PROTECTED]
Web Interface: 
http://intm-dl.sparklist.com/cgi-bin/lyris.pl?enter=nt2000&text_mode=&lang=english
To unsubscribe send a blank email to [EMAIL PROTECTED]

Reply via email to