rename folder with time and date in DOS

November 25, 2009 at 18:26:00
Specs: Windows XP
hello experts,
i need your help to rename a folder in batch script with time and date

for example

ren C:\amab_fin\temphold MyFile__%dd:~0,2%_%dd:~3,2%_%dd:~6,4%___%dd:~11,2%_%dd:~14,2%
i tried the above coding, showing incorrect command
Hope somebody help me in this

See More: rename folder with time and date in DOS

Report •

November 25, 2009 at 20:26:02
Y no reply???
some one plzz help me

Report •

November 25, 2009 at 20:35:11
Can you please post the output of the below. Please also explain what each digit represents - i.e. hh:mm:ss, dd:mm:yy.

echo %date%
echo %time%

The date format in particular varies according to regional settings. This means even if the script does work a change of settings can cause it to stop working.

Please understand nobody is paid to answer you questions, every couple of days some one is asking for almost exactly the same thing you are.

One thing I forgot to mention is that xp batch scripting is not dos, nor is the command line. The command line is *mostly* compatible with old dos scripts and commands, but has many features the dos doesn't. The command processor is as much dos as an emulator is a real hardware gaming system.

Batch Variable how to

Report •

November 25, 2009 at 21:13:21
agree with Judago in that the contents of %dd% need to be established. Other than that, my probes of the code you wrote didn't kick any errors, so most likely due to the contents of the variable %dd%. My system puts dofw space
then standard date. if your dd variable is pickiing up a space from %date%, that could be the problem.

echo %dd% >

Report •

Related Solutions

Ask Question