[THIN] Re: OT - Batch scripters - Help an amateur.

  • From: "Ryan Lambert" <rlambert@xxxxxxxxxxxxxxx>
  • To: <thin@xxxxxxxxxxxxx>
  • Date: Tue, 23 Dec 2003 00:32:58 -0500

Thanks guys.

 

I got it to work. In MMDD_HHMM

 

for /f "tokens=2-6 delims=-/,.: " %%i in (

'echo exit^|cmd /q /k prompt $D $T') do (

set timestamp=%%i%%j_%%l%%m)

 

 

-----Original Message-----
From: Columna, Melvin [mailto:Melvin.Columna@xxxxxxxxx] 
Sent: Monday, December 22, 2003 6:56 PM
To: 'thin@xxxxxxxxxxxxx'
Subject: [THIN] Re: OT - Batch scripters - Help an amateur.

 

I was looking at that, but I didn't know how "basic" to keep it.

-----Original Message-----
From: Carl Stalhood [mailto:cstalhood@xxxxxxxxxxxxx]
Sent: Monday, December 22, 2003 5:59 PM
To: thin@xxxxxxxxxxxxx
Subject: [THIN] Re: OT - Batch scripters - Help an amateur.

To get a numeric date and time on Windows 2000 and above, you can do
something like this:

 

set mydate=%date:~4,2%%date:~7,2%%date:~10,4%

set mytime=%time:~0,2%%time:~3,2%

echo %mydate% %mytime%

 

Run set /? for more information on this syntax.

 

Carl Stalhood


  _____  


From: thin-bounce@xxxxxxxxxxxxx [mailto:thin-bounce@xxxxxxxxxxxxx] On
Behalf Of Columna, Melvin
Sent: Monday, December 22, 2003 4:28 PM
To: 'thin@xxxxxxxxxxxxx'
Subject: [THIN] Re: OT - Batch scripters - Help an amateur.

 

It's because of the colons and slashes in the date/time.  Can you live
without the date/time in the filename and just use the date/time stamp
on the file?  Can you live with some random numbers?

 

%RAND% generates a number between 0 and 32767.  (tested on Windows 2000
Pro only!)

If you Specified Folder has spaces in the name (like C:\Program Files)
enclose the name in quotes as shown in the example

 

SET RAND=%RANDOM%%RANDOM%.TXT
SET MYFILE=11myfile.ORA
REN %MYFILE% %MYFILE%%RAND%
MOVE %MYFILE%%RAND% "C:\Specified Folder"

Now, I also see that you fiddle with the filename, is that intentional
or just typing junk into the KB ???

 

Lastly, the correct format is %date% and %time% not $date (that would
work in Unix)

-----Original Message-----
From: Ryan Lambert [mailto:rlambert@xxxxxxxxxxxxxxx]
Sent: Monday, December 22, 2003 3:29 PM
To: thin@xxxxxxxxxxxxx
Subject: [THIN] OT - Batch scripters - Help an amateur.

Hi guys,

 

Very basic issue here.

 

I get a file named: aut.edtout.dgzfex11.dcrd

 

I want to run a script that will take that file, rename it to
aut.home.dgzfex11.$date$time.txt (based on the time the script was run),
then copy it to the c:\Specified  folder.

 

Basic, but I can't get the timestamp to go with the filename correctly.
:-)

 

--

Ryan Lambert, MCP, CCA

Network Engineer

NetSource

1242 East 49th St.

Suite 503-B, Third Floor

Cleveland, OH 44114

Ph/Fax: 216-373-2757

http://www.netsourceit.com/

 

Other related posts: