Ucc
09-18-2006, 04:37 AM
Hi,
I am beginner in command prompt programming, and I need help on how to create a new directory using the Dayname generated from the system.
For example: Mon, Tue, Wed, etc..
Please help.
And also I have this sample of command prompt (batch files) that already created before by someone else, the syntax are as follows:
set options="tokens=1"
for /F %options% %%g in (%temp%\z1) do set z1=%%g
for /F %options% %%g in (%temp%\z2) do set z2=%%g
::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
set temp1=%temp%\temp1.tmp
if exist %temp1% del %temp1%
date /t>>%temp1%
set options1="eol=; tokens=1,2,3,4* delims=/, "
for /f %options1% %%i IN (%temp1%) do set yyyymmdd=%%l%%k%%j
for /f %options1% %%i IN (%temp1%) do set ddd=%%i
::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
set temp2=%temp%\temp2.tmp
set temp3=%temp%\temp3.tmp
if exist %temp2% del %temp2%
if exist %temp3% del %temp3%
time /t>>%temp2%
set options2="tokens=1,2 delims=:"
for /f %options2% %%g in (%temp2%) do echo %%g%%h>>%temp3%
set options3="tokens=1 delims= "
for /f %options3% %%g in (%temp3%) do set hhmm=%%g
::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
cd 02_Backups
if exist %ddd% del /Q /F %ddd%
md %ddd%
I understand the logical of that batch files are used to make directory using the Time systems, but somehow it didn't work. And last question is, anybody knows why should have to create the temp file first?
Thank you in advance.
Regards,
Ucc
I am beginner in command prompt programming, and I need help on how to create a new directory using the Dayname generated from the system.
For example: Mon, Tue, Wed, etc..
Please help.
And also I have this sample of command prompt (batch files) that already created before by someone else, the syntax are as follows:
set options="tokens=1"
for /F %options% %%g in (%temp%\z1) do set z1=%%g
for /F %options% %%g in (%temp%\z2) do set z2=%%g
::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
set temp1=%temp%\temp1.tmp
if exist %temp1% del %temp1%
date /t>>%temp1%
set options1="eol=; tokens=1,2,3,4* delims=/, "
for /f %options1% %%i IN (%temp1%) do set yyyymmdd=%%l%%k%%j
for /f %options1% %%i IN (%temp1%) do set ddd=%%i
::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
set temp2=%temp%\temp2.tmp
set temp3=%temp%\temp3.tmp
if exist %temp2% del %temp2%
if exist %temp3% del %temp3%
time /t>>%temp2%
set options2="tokens=1,2 delims=:"
for /f %options2% %%g in (%temp2%) do echo %%g%%h>>%temp3%
set options3="tokens=1 delims= "
for /f %options3% %%g in (%temp3%) do set hhmm=%%g
::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
cd 02_Backups
if exist %ddd% del /Q /F %ddd%
md %ddd%
I understand the logical of that batch files are used to make directory using the Time systems, but somehow it didn't work. And last question is, anybody knows why should have to create the temp file first?
Thank you in advance.
Regards,
Ucc