home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
High Voltage Shareware
/
high1.zip
/
high1
/
DIR4
/
SETDT110.ZIP
/
SETDT.DOC
< prev
next >
Wrap
Text File
|
1993-09-29
|
3KB
|
94 lines
Name: SETDT.DOC - Documentation file for SETDT.EXE Page 1 of 2
Purpose: SETDT.EXE gets the system's current date and time, parses
it, and writes the results to "SET_DT.BAT" in the current
directory. When "SET_DT.BAT" is subsequently run it sets
the following environment variables:
MM=nn (Month)
DD=nn (Day)
YY=nn (Year)
HR=nn (Hour)
MN=nn (Minute)
SC=nn (Second)
Syntax: SETDT
Notes: Use the following three lines in a BATch file to call both
SETDT.EXE and SET_DT.BAT, and then delete the SET_DT.BAT:
SETDT.EXE
call SET_DT.BAT
del SET_DT.BAT
Example of what's in SET_DT.BAT when SETDT.EXE is run:
@echo off
set mm=09
set dd=29
set yy=93
set hr=07
set mn=43
set sc=11
Then when SET_DT.BAT is subsequently run the following will
be in your environment (type SET to view the environment):
mm=09
dd=29
yy=93
hr=07
mn=43
sc=11
A use for the above for example, would be to create a file
using the system's current date as a filename for a nightly
ZIP file of whatever. Example ZIP command:
PKZIP -ex -i -a+ C:\WP51\DATA\*.* %YY%%MM%%DD%
would create a ZIP file named 930929.ZIP containing any
files in the C:\WP51\DATA directory that had the "A"rchive
attribute set and subsequently remove the "A" attribute.
Name: SETDT.DOC - Documentation file for SETDT.EXE Page 2 of 2
Another use would be as an automatic TAPE name when erasing
or formatting tapes from the command line using Colorado
Memory's TAPE.EXE program. For instance, when I format a
tape (with version 2.54 of TAPE.EXE) I use the command:
TAPE FORMAT /N="%yy%%mm%%dd%f%hh%%mm%"
(the "f" between the date and time means the tape was
formatted, not simply "e" for erased).
Misc: The QBASIC code used to create SETDT.EXE:
OPEN "set_dt.bat" FOR OUTPUT AS #1
d$ = DATE$
mm$ = MID$(d$, 1, 2)
dd$ = MID$(d$, 4, 2)
yy$ = MID$(d$, 9, 2)
t$ = TIME$
hr$ = MID$(t$, 1, 2)
mn$ = MID$(t$, 4, 2)
sc$ = MID$(t$, 7, 2)
PRINT #1, "@echo off"
PRINT #1, "set mm="; mm$
PRINT #1, "set dd="; dd$
PRINT #1, "set yy="; yy$
PRINT #1, "set hr="; hr$
PRINT #1, "set mn="; mn$
PRINT #1, "set sc="; sc$
CLOSE
SETDT.BAS was compiled with Turbo Basic and then compressed
with PKLITE.
This utility is released into the Public Domain as Freeware
and no charges whatsoever are allowed for SETDT.EXE's use.
(c)Copyright 1993 Vernon J Frazee -vjf-