Solved

Manipulating strings in a Windows 2000 batch file.

Posted on 2004-04-07
5
359 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
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

Use Case: Protecting a Hybrid Cloud Infrastructure

Microsoft Azure is rapidly becoming the norm in dynamic IT environments. This document describes the challenges that organizations face when protecting data in a hybrid cloud IT environment and presents a use case to demonstrate how Acronis Backup protects all data.

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…
Changing a few Outlook Options can help keep you organized!

737 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