For instance.
%myfile=jfj.txt
%dtstamp=`whatever code generates MMDDYYYYHHMMSS` (what
code will do this?)
%newfilename=%myfile appended with $dtstamp (how?)
move %myfile %newfilename
for /f "tokens=2-7 delims=/:. " %%a in ("%DATE% %TIME%") do (
set DATETIME=%%a%%b%%c%%d%%e%%f
)
echo %DATETIME%
[/SCRIPT]
HTH
Dean
--
Dean Wells [MVP / Windows platform]
MSEtechnology
dwe...@msetechnology.com
[[ Please respond to the Newsgroup only ]]
"Jesse Josserand" <jjoss...@eprod.com> wrote in message
news:029001c2c189$9d448930$d4f82ecf@TK2MSFTNGXA11...
Use something like this to get the date/time as it'll work on NT/2K/XP
and is fairly tolerent of the current date/time regional settings:-
========================= start =========================================
echo off&setlocal
call :GetDate yy mm dd
call :GetTime hh nn ss tt
echo/Date and time is: %mm%%dd%%yy%%hh%%nn%%ss%
echo/As for the rest of what you want to do, I'm sure
echo/you'll work it out.
goto :EOF
:::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
:GetDate yy mm dd
setlocal ENABLEEXTENSIONS
set t=2&if "%date%z" LSS "A" set t=1
for /f "skip=1 tokens=2-4 delims=(-)" %%a in ('echo/^|date') do (
for /f "tokens=%t%-4 delims=.-/ " %%d in ('date/t') do (
set %%a=%%d&set %%b=%%e&set %%c=%%f))
endlocal&set %1=%yy%&set %2=%mm%&set %3=%dd%&goto :EOF
:::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
:::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
:GetTime hh nn ss tt
setlocal ENABLEEXTENSIONS
for /f "tokens=5-8 delims=:. " %%a in ('echo/^|time') do (
set hh=%%a&set nn=%%b&set ss=%%c&set cs=%%d)
if 1%hh% LSS 20 set hh=0%hh%
endlocal&set %1=%hh%&set %2=%nn%&set %3=%ss%&set %4=%cs%&goto :EOF
:::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
========================= end =========================================
--
Ritchie
[SCRIPT]
set MYFILE=jfi.txt
for /f "tokens=2-7 delims=/:. " %%a in ("%DATE% %TIME%") do (
set NEWFILE=%%a%%b%%c%%d%%e%%f
)
for %%V in ("%MYFILE%") do (
set NEWFILE=%%~nV%NEWFILE%%%~xV
)
echo %NEWFILE%
[/SCRIPT]
Dean
--
Dean Wells [MVP / Windows platform]
MSEtechnology
dwe...@msetechnology.com
[[ Please respond to the Newsgroup only ]]
"Dean Wells" <dwe...@mask.msetechnology.com> wrote in message
news:O3Cj70YwCHA.2640@TK2MSFTNGP11...
<URL:http://homepages.tesco.net./~J.deBoynePollard/FGA/common-tasks-with-jpsoft-clis.html#DateInName>