On Fri, 5 Jan 2018 01:47:56 -0800 (PST),
ada...@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.