Not sure if anyone is interested or not, but here was my answer (from
another list)

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
FOR /f "delims=/ tokens=1,2,3" %%A in ("%TheDate%") DO SET YEAR=%%C

ECHO Month=%Month%  Day=%Day%    Year = %Year%

-----Original Message-----
From: Duane Boudreau [mailto:[EMAIL PROTECTED]
Sent: Thursday, June 26, 2003 10:53 AM
To: CF-Community
Subject: batch file


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 and I want to use parts of the
system date to name the resulting zip file.

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 reference
site?

Duane



~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Archives: http://www.houseoffusion.com/cf_lists/index.cfm?forumid=5
Subscription: 
http://www.houseoffusion.com/cf_lists/index.cfm?method=subscribe&forumid=5

Host with the leader in ColdFusion hosting. 
Voted #1 ColdFusion host by CF Developers. 
Offering shared and dedicated hosting options. 
www.cfxhosting.com/default.cfm?redirect=10481

                                Unsubscribe: 
http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.5
                                

Reply via email to