[Okta Webinar] Learn how to a build a cloud-first strategyRegister Now

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 369
  • Last Modified:

Manipulating strings in a Windows 2000 batch file.

I want to create a batch file that will take the current date, convert it to DDMMYY and the create a directory named ..../BACKUPDDMMYY and then be able to use the path to the directory in COPY/XCOPY statements.

Help!!

Simon.
0
simonk_klammer
Asked:
simonk_klammer
1 Solution
 
XionNETCommented:
I was able to write one that would have the format DDMMYYYY in case you are interested. This will assign the date DDMMYYYY to %%date

for /f "tokens=1,2,3,4* delims=/ " %%i in ('date /t') do set date=%%k%%j%%l
0
 
simonk_klammerAuthor Commented:
Sorry.  I'm new to the forum.  Can I change the grade?
0
 
jzanetteCommented:
You might also try using the YYYYMMDD format as this will provide easier sorting.

The Mount/\Command "GetLogDate" is free and provides YYYYMMDD consistently across Windows versions (NT, 2000, XP and Server 2003).

For a better description, see (http://TheSystemGuard.com/MtCmds/GetValue/GetLogDate.htm).  To get the free Advanced NT/2K/XP/K3 Command Library, see (http://ntlib.com).
0

Featured Post

Hire Technology Freelancers with Gigs

Work with freelancers specializing in everything from database administration to programming, who have proven themselves as experts in their field. Hire the best, collaborate easily, pay securely, and get projects done right.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now