Solved

Manipulating strings in a Windows 2000 batch file.

Posted on 2004-04-07
5
354 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

Find Ransomware Secrets With All-Source Analysis

Ransomware has become a major concern for organizations; its prevalence has grown due to past successes achieved by threat actors. While each ransomware variant is different, we’ve seen some common tactics and trends used among the authors of the malware.

Join & Write a Comment

Suggested Solutions

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…
We have come a long way with backup and data protection — from backing up to floppies, external drives, CDs, Blu-ray, flash drives, SSD drives, and now to the cloud.
This video shows how to remove a single email address from the Outlook 2010 Auto Suggestion memory. NOTE: For Outlook 2016 and 2013 perform the exact same steps. Open a new email: Click the New email button in Outlook. Start typing the address: …
This video explains how to create simple products associated to Magento configurable product and offers fast way of their generation with Store Manager for Magento tool.

762 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

Need Help in Real-Time?

Connect with top rated Experts

23 Experts available now in Live!

Get 1:1 Help Now