RE: DOS question

  • From: "Johnson, George" <GJohnson@xxxxxxx>
  • To: "'BranimirP@xxxxxxxx'" <BranimirP@xxxxxxxx>, Oracle-L@xxxxxxxxxxxxx
  • Date: Thu, 2 Dec 2004 14:06:03 -0000

        I used these tricks to make time/date dated directories for Oracle
disk based backups on NT4 servers. If my memory serves me correctly you need
to set TIME and DATE using the the time and date commands from the O/S.

        Try:  
                Dates:
                for /F "tokens=2,3,4 delims=/- " %%A in ('date /T') do set
DT=%%C_%%B_%%A
        
                (Adjust C B A for your local date convention C B A is UK
"day month year")

                Times:
                for /F "tokens=1,2 delims=/: " %%A in ('time /T') do set
TM=%%A-%%B

        Rgds
        Gj

-----Original Message-----
From: Branimir Petrovic [mailto:BranimirP@xxxxxxxx] 
Sent: 02 Dec 2004 13:36
To: Oracle-L@xxxxxxxxxxxxx
Subject: RE: DOS question


While quite an accomplishment considering DOS batch shortcomings, env.
variables %date% and %time% are unknowns on NT 4, therefore 
the trick can not be successfully applied in WinNT4-Win2K3 range.

After let's say "interesting" day yesterday at customer's site  
and the way some environment variables are/aren't available with 
scheduled scripts on NT4, I am more convinced than ever that any 
reliance on Windows DOS batch-ing and/or native (*.wsf, *.vbs, 
*.js) scripting should be avoided like a plague...

Branimir


> -----Original Message-----
> From: Alexander.Feinstein@xxxxxxxxxxxxx
> 
> 
> Here is another alternate that works:
> 
> for /F "tokens=3D1-4 delims=3D/ " %%o in ("%DATE%") do (
>   set MM=3D%%p
>   set DD=3D%%q
>   set YY=3D%%r
> )
> for /F "tokens=3D1-5 delims=3D.:" %%s in ("%TIME%") do (
>   set HH=3D%%s
>   set MI=3D%%t
>   set SS=3D%%u
> )
> set CURR_DATE=3D%YY%%MM%%DD%%HH%%MI%%SS%
> set CURR_DATE=3D%CURR_DATE: =3D0%
> 
--
//www.freelists.org/webpage/oracle-l


****************************************************************************
This message contains confidential information and is intended only 
for the individual or entity named.  If you are not the named addressee
you should not disseminate, distribute or copy this e-mail.  
Please notify the sender immediately by e-mail if you have received 
this e-mail by mistake and delete this e-mail from your system.
E-mail transmission cannot be guaranteed to be secure or error-free
as information could be intercepted, corrupted, lost, destroyed, arrive
late or incomplete, or contain viruses.  The sender therefore does not
accept liability for any errors or omissions in the contents of this 
message which arise as a result of e-mail transmission.  
If verification is required please request a hard-copy version.
This message is provided for informational purposes and should not
be construed as an invitation or offer to buy or sell any securities or
related financial instruments.
GAM operates in many jurisdictions and is 
regulated or licensed in those jurisdictions as required.
****************************************************************************

--
//www.freelists.org/webpage/oracle-l

Other related posts: