> -----Original Message-----
> From: Murali_Pavuloori/[EMAIL PROTECTED]
> [mailto:Murali_Pavuloori/[EMAIL PROTECTED]
> Sent: September 24, 2003 1:45 PM
> To: Multiple recipients of list ORACLE-L
> Subject: how to generate unique file names on Windows.
> 
> 
> 
> Hello,
> 
> I am trying to write a script on windows that would export 
> the db every
> night. Can someone tell me how to generate unique file names 
> on windows...
> 
> What I am looking for is the windows equivalent of  echo 
> `date +%m%d%y`
> 
> Thanks in advance.
> 
> Murali.
> 

Dynamically generated timestamp is what you want. Be warned
though that this works only on Win2K and 'better':

C:\>set zdate=_%date:~-4%%date:~7,2%%date:~4,2%
C:\>set ztime=_%time:~0,2%%time:~3,2%%time:~6,2%
C:\>echo %zdate%%ztime%
_20030924_152452

On (not so) good ole NT4 this has to be done:

:: === Create and initialize TIMESTAMP and NOW environment vars: 
::                      set TIMESTAMP=_YYYYMMDD_HHMMSS
::                      set NOW=DD Month YYYY  HH:MM:SS
if EXIST SetTIMESTAMP.bat del /f /q SetTIMESTAMP.bat
MakSetTIMESTAMPbat.wsf
if exist SetTIMESTAMP.bat (
    call SetTIMESTAMP.bat
    del /f /q SetTIMESTAMP.bat
)

MakSetTIMESTAMPbat.wsf script dynamically creates SetTIMESTAMP.bat script. 
Execute that to create and initialize TIMESTAMP environment variable 
(mail me off-line if you want this script making script).

Sooo much simpler/easier, more logical wouldn't you say than having 
to remember/worry about meaning of backticks in shell?

Branimir


-- 
Please see the official ORACLE-L FAQ: http://www.orafaq.net
-- 
Author: Branimir Petrovic
  INET: [EMAIL PROTECTED]

Fat City Network Services    -- 858-538-5051 http://www.fatcity.com
San Diego, California        -- Mailing list and web hosting services
---------------------------------------------------------------------
To REMOVE yourself from this mailing list, send an E-Mail message
to: [EMAIL PROTECTED] (note EXACT spelling of 'ListGuru') and in
the message BODY, include a line containing: UNSUB ORACLE-L
(or the name of mailing list you want to be removed from).  You may
also send the HELP command for other information (like subscribing).

Reply via email to