PDA

View Full Version : starutil automatition with date variable


cdavis
11-14-2002, 02:21 PM
Anyone know an easy way to create a backup using the current date as the filename variable (NT system)?

Something like this:
starutil 1.2.3.4 pass -d %date%

cdavis
11-23-2002, 02:23 PM
This seems to work on my xp machine.

#@echo off
if "%date%A" LSS "A" (set toks=1-3) else (set toks=2-4)
for /f "skip=1 tokens=2-4 delims=(-)" %%a in ('echo:^|date') do (
for /f "tokens=%toks% delims=.-/ " %%d in ('date/t') do (
set %%a=%%d
set %%b=%%e
set %%c=%%f
set toks=
)
)
#echo %yy%-%mm%-%dd%
starutil 1.2.3.4 mypass -d %yy%-%mm%-%dd%.dat