You are not logged in.

#1 31 Mar 2007 09:47

momtat
Member
Registered: 31 Mar 2007
Posts: 3

Renaming the file with a current time

Hi,
I want to rename my file in a specific folder to the current time, for example: my file name is test.txt and i want to rename it to test-114516.txt (if the time is 11:45:16). using command script in Windows.

Thank you and best Regards

Offline

#2 31 Mar 2007 11:08

Simon Sheppard
Admin
Registered: 27 Aug 2005
Posts: 1,130
Website

Re: Renaming the file with a current time

see the stampme scripts here

http://www.ss64.com/ntsyntax/

Offline

#3 31 Mar 2007 12:43

momtat
Member
Registered: 31 Mar 2007
Posts: 3

Re: Renaming the file with a current time

Hi, thank you for your guide, I have tried the StampMe.cmd for renaming the file to the current date and time.
But it does not work with me, my file name is NAWPF.txt , so I used the last line in the command as:
REN %C:\Backup\NWAPF.txt% %NWAPF.txt%-%_yy%-%_mm%-%_dd%@%_hr%-%_min%%_ext%"
So is this correct ? how should I make it?

Thank you

Offline

#4 31 Mar 2007 17:00

Simon Sheppard
Admin
Registered: 27 Aug 2005
Posts: 1,130
Website

Re: Renaming the file with a current time

no just save the whole script as stampme.cmd

then run

STAMPME "C:\Backup\NWAPF.txt"

Offline

#5 01 Apr 2007 07:41

momtat
Member
Registered: 31 Mar 2007
Posts: 3

Re: Renaming the file with a current time

Hi

It is working fine

Thanks a lot for your kindly assistance.

Regards
Mohammed

Offline

Board footer

Powered by