Forums before death by AOL, social media and spammers... "We can't have nice things"
|    alt.msdos.batch.nt    |    Fun with Windows NT batch files    |    68,980 messages    |
[   << oldest   |   < older   |   list   |   newer >   |   newest >>   ]
|    Message 67,117 of 68,980    |
|    Climate Hillbilly Davis to All    |
|    Re: Rename One File In Batch To It's Mod    |
|    05 Jan 18 04:23:08    |
   
   From: hillbilly@appalachia.com   
      
   On Fri, 5 Jan 2018 01:47:56 -0800 (PST), adam_l@poczta.onet.pl says...   
      
   Need to rename one file in batch to it's created date, i.e.,   
   "latest.gho" > "createddate.gho"   
      
   Format example: "01-04-2018.gho"   
      
   Just one file, not a group.   
      
   I use this to rename it to current date: if exist D:\Latest.gho for /f   
   "tokens=1-5 delims=/ " %%d in ("%date%") do rename "D:\Latest.gho" %%e-%%   
   f-%%g_C.gho   
      
   Thanks.   
      
   > FOR %%i IN ("latest.gho") DO SET MYVAR=%%~ti   
      
   Thanks, but that seems to be incomplete. I'm running this from explorer,   
   not a command line.   
      
   I double click on the batch file and it changes the name of current ghost   
   file, then it runs ghost64.exe, naming it latest.gho.   
      
   This is how I had it set up before. Simple batch file.   
      
   =====   
      
   @echo on   
   cls   
   if exist D:\Latest.gho for /f "tokens=1-5 delims=/ " %%d in ("%date%") do   
   rename "D:\Latest.gho" %%e-%%f-%%g-rename_me.gho   
      
   move *.gho d:\ghost files\SSD1   
      
   H:\Programs\Ghost\Ghost32\Ghost64.exe -clone,mode=pcreate,src=1:1,dst="%%   
   e-%%f-%%g.gho", -sure   
      
   if exist D:\Latest.gho for /f "tokens=1-5 delims=/ " %%d in ("%date%") do   
   rename "D:\Latest.gho" %%e-%%f-%%g.gho   
      
   move *.gho d:\ghost files\SSD1   
      
   =====   
      
   I want the "old" file to be renamed to the its created or modified date,   
   not the system date.   
      
   rename latest.gho --> 01-05-2018.gho then move 01-05-2018.gho to different   
      
   then run ghost64.exe and have it name it latest then move it too.   
      
   I can easily do this manually, but it's a one click process now.   
      
   --- SoupGate-Win32 v1.05   
    * Origin: you cannot sedate... all the things you hate (1:229/2)   
|
[   << oldest   |   < older   |   list   |   newer >   |   newest >>   ]
(c) 1994, bbs@darkrealms.ca