Home All Groups Group Topic Archive Search About
Author
28 Mar 2005 3:27 PM
John
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
cls ------------------------------------------------------------------------------------------------

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

Author
28 Mar 2005 8:57 PM
Royce
john not exactly sure what your question is.... so your going to move the
file from one location to another using xcopy? why couldnt you just make the
log in the correct location the first time... im not very clear on all of
this. is there something that im missing?


Show quoteHide quote
"John" wrote:

> 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
> cls
> ------------------------------------------------------------------------------------------------
>
> 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
Author
28 Mar 2005 10:01 PM
John
i mean i am copiying the log file into another server Royce. thats why i am
using XCOPY.

thank you very much for yoru help.

can you please help me in this scenario.

Show quoteHide quote
"Royce" wrote:

> john not exactly sure what your question is.... so your going to move the
> file from one location to another using xcopy? why couldnt you just make the
> log in the correct location the first time... im not very clear on all of
> this. is there something that im missing?
>
>
> "John" wrote:
>
> > 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
> > cls
> > ------------------------------------------------------------------------------------------------
> >
> > 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
Author
28 Mar 2005 10:47 PM
Royce
do you want the log(s) to be on both servers?  can you post a copy of your
batch or what you have so far?

Show quoteHide quote
"John" wrote:

> i mean i am copiying the log file into another server Royce. thats why i am
> using XCOPY.
>
> thank you very much for yoru help.
>
> can you please help me in this scenario.
>
> "Royce" wrote:
>
> > john not exactly sure what your question is.... so your going to move the
> > file from one location to another using xcopy? why couldnt you just make the
> > log in the correct location the first time... im not very clear on all of
> > this. is there something that im missing?
> >
> >
> > "John" wrote:
> >
> > > 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
> > > cls
> > > ------------------------------------------------------------------------------------------------
> > >
> > > 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