The UNIX and Linux Forums  

Go Back   The UNIX and Linux Forums > Special Forums > Windows & DOS: Issues & Discussions
.
google unix.com




View Single Post in the UNIX and Linux Forums - Click on the Thread or Permalink to View Entire Thread -->
  #16 (permalink)  
Old 04-06-2009
ilan ilan is offline
Registered User
  
 

Join Date: Jul 2007
Posts: 101
siquadri,

ren Test*.txt "Test%Date:/= % %Time::=.%.txt"

The above command is suggested to rename a file through a script with the current data and time; and is also an good illustration of character replace in batch scripts..

if you do a.. echo %Date:/= % it will replace : with a blank space

examples:

C:\Documents and Settings\ilango>echo %Date:/= %
Mon 04 06 2009

C:\Documents and Settings\ilango>echo %Date:/=;%
Mon 04;06;2009

C:\Documents and Settings\ilango>echo %Date:/=ilan%
Mon 04ilan06ilan2009

C:\Documents and Settings\ilango>echo %Date:/=*ilan*%
Mon 04*ilan*06*ilan*2009


/ilan