Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.server -> Re: Is NT 2000 Dos Batch Timestamp sysntax different ?

Re: Is NT 2000 Dos Batch Timestamp sysntax different ?

From: Joe Caporina <spam_at_nospam.com>
Date: Thu, 10 Oct 2002 16:46:29 -0700
Message-ID: <3da5f456$1_10@news.newsgroups.com>


Thanks Simon,
How should I edit the exiting NT batch file TODAY%_%HR%_%MIN% varaibles for renaming the LOG file with date and time ? *J

rem EXP.BAT
cd/d d:\oracle\admin\PDS\script
set time_stamp=.
FOR /F "tokens=1-3 delims= " %%A in ("%date%_%time%") do set time_stamp=%%B%%C
FOR /F "tokens=1-3 delims=/" %%A in ("%time_stamp%") do set time_stamp=%%A%%B%%C
FOR /F "tokens=1-3 delims=:" %%A in ("%time_stamp%") do set time_stamp=%%A%%B%%C
FOR /F "tokens=1-2 delims=." %%A in ("%time_stamp%") do set time_stamp=%%A%%B
call exp1.bat
sendmail -t securityadministrator_at_equine.com -f parapp06 -s "PARAPP06 CHECK - PDS" -b
\\parapp06.pap.starent.com\d$\oracle\admin\PDS\exp\pdsexp%TODAY%_%HR%_%MIN%. LOG "Simon Sheppard" <simon_at_spam.invalid> wrote in message news:3da5e671.3213420_at_news.demon.co.uk...
> On 9 Oct 2002 17:21:37 -0700, rs_arwar_at_hotmail.com (Rauf Sarwar)
> wrote:
>
> >This works on Win2K. Have not tested it on WinNT.
> >
> >Use %%VAR for batch file. Use %VAR for command line.
> >
> >For Date_Timestamp
> >set time_stamp=.
> >FOR /F "tokens=1-3 delims= " %%A in ("%date%_%time%") do set
time_stamp=%%B%%C
> >FOR /F "tokens=1-3 delims=/" %%A in ("%time_stamp%") do set
time_stamp=%%A%%B%%C
> >FOR /F "tokens=1-3 delims=:" %%A in ("%time_stamp%") do set
time_stamp=%%A%%B%%C
> >FOR /F "tokens=1-2 delims=." %%A in ("%time_stamp%") do set
time_stamp=%%A%%B
>
> WinNT does not include the %date% or %time% variables
> here's something that will work under both NT and 2000
> All lines should be indented 3 chars...
>
> @echo off&SETLOCAL
>
> :: This will return date into environment vars
> :: Works on any NT/2K/XP machine independent of regional date
> settings
> :: 20 March 2002
>
> FOR /f "tokens=1-4 delims=/-. " %%G IN ('date /t') DO (call
> :s_fixdate %%G %%H %%I %%J)
> goto :s_print_the_date
>
> :s_fixdate
> if "%1:~0,1%" GTR "9" shift
> FOR /f "skip=1 tokens=2-4 delims=(-)" %%G IN ('echo.^|date') DO (
> set %%G=%1&set %%H=%2&set %%I=%3)
> goto :eof
>
> :s_print_the_date
> echo Month:[%mm%] Day:[%dd%] Year:[%yy%]
> ENDLOCAL&SET mm=%mm%&SET dd=%dd%&SET yy=%yy%
>
>
> And to answer the original subject line
> Is NT 2000 Dos Batch Timestamp syntax different ?
> YES the NT command prompt is different to the 2000 command prompt
> which in turn is *very* different to the DOS operating system.
>
> http://www.ss64.demon.co.uk/ntsyntax/GetDate.txt
>
> -
> Simon Sheppard
> http://www.ss64.com
> -

-----------== Posted via Newsfeed.Com - Uncensored Usenet News ==----------

   http://www.newsfeed.com The #1 Newsgroup Service in the World! -----= Over 100,000 Newsgroups - Unlimited Fast Downloads - 19 Servers =----- Received on Thu Oct 10 2002 - 18:46:29 CDT

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US