Solved

Manipulating strings in a Windows 2000 batch file.

Posted on 2004-04-07
5
357 Views
Last Modified: 2007-12-19
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
Comment
Question by:simonk_klammer
5 Comments
 
LVL 1

Accepted Solution

by:
XionNET earned 250 total points
ID: 10779477
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
 

Author Comment

by:simonk_klammer
ID: 10822432
Sorry.  I'm new to the forum.  Can I change the grade?
0
 

Expert Comment

by:jzanette
ID: 10840216
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

Enterprise Mobility and BYOD For Dummies

Like “For Dummies” books, you can read this in whatever order you choose and learn about mobility and BYOD; and how to put a competitive mobile infrastructure in place. Developed for SMBs and large enterprises alike, you will find helpful use cases, planning, and implementation.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

NTFS file system has been developed by Microsoft that is widely used by Windows NT operating system and its advanced versions. It is the mostly used over FAT file system as it provides superior features like reliability, security, storage, efficienc…
If you are looking at this article, you have most likely been hit by some version of ransomware and are trying to find out if there is anything you can do, or what way you should react - READ ON!
This video shows how to quickly and easily add an email signature for all users on Exchange 2016. The resulting signature is applied on a server level by Exchange Online. The email signature template has been downloaded from: www.mail-signatures…
Finds all prime numbers in a range requested and places them in a public primes() array. I've demostrated a template size of 30 (2 * 3 * 5) but larger templates can be built such 210  (2 * 3 * 5 * 7) or 2310  (2 * 3 * 5 * 7 * 11). The larger templa…

856 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question