G
Guest
add this to the top of your batch file.
to set file name to date- %xdate%.log
to set file name to time- %xtime%.log
to set file name to time and date- %xtime%%xdate%.log
ex.date= 03-23-2005.log
ex.time= 16.30.log
ex.time & date= 16.30 03-23-2005.log
------------------------------------------------------------------------------------------------
@echo off
setlocal
for /f "tokens=2-4 delims=/ " %%a in (
'date /t'
) do set xdate=%%a-%%b-%%c
for /f "tokens=5-6 delims=:. " %%a in (
'echo/^|time^|find "current"'
) do set xtime=%%a.%%b
cl
------------------------------------------------------------------------------------------------
hope this helps. let me know if you have any problems...
Thanks for the reply from Royce.
Can you please advise me my file is going to created by the time daily 1.00
am.
my file location is: F:\Logs\WWWLogs\W3SVC1\ex030527.LOG.
I am going to move this file from here to another location using XCOPY.
What points should i take care of, thanks for all.
John
to set file name to date- %xdate%.log
to set file name to time- %xtime%.log
to set file name to time and date- %xtime%%xdate%.log
ex.date= 03-23-2005.log
ex.time= 16.30.log
ex.time & date= 16.30 03-23-2005.log
------------------------------------------------------------------------------------------------
@echo off
setlocal
for /f "tokens=2-4 delims=/ " %%a in (
'date /t'
) do set xdate=%%a-%%b-%%c
for /f "tokens=5-6 delims=:. " %%a in (
'echo/^|time^|find "current"'
) do set xtime=%%a.%%b
cl
------------------------------------------------------------------------------------------------
hope this helps. let me know if you have any problems...
Thanks for the reply from Royce.
Can you please advise me my file is going to created by the time daily 1.00
am.
my file location is: F:\Logs\WWWLogs\W3SVC1\ex030527.LOG.
I am going to move this file from here to another location using XCOPY.
What points should i take care of, thanks for all.
John