B
bladeraptor
Hi
I am trying to create a batch file which will append the date to a
series of file that are moved from another folder. So there will need
to be the use of wildcards for the files - as the filenames will vary.
The batch sequence below is what I have so far - the problem is I did
not write this myself - I am very new to batch and as you can see the
second section of the batch - the bit that actualy does the renaming
was designed for the user to input the desired date when calling the
batch from the run or command line.
What I am trying to do is get this second portion to accept the output
of the first section of the batch - the first section creates the time
/ date reference as the input. The porblem seems to be all the
associated viariables - any help would be appreciated.
This needs to run on both 2000 and NT4
Regards
Alex Tanner
The batch is as follows:
if "%1"=="GoTo" goto %2
echo e180 BF 07 01 B4 04 CD 1A E8 02 00 89 CA E8 00 00> %temp%.\t1.src
echo e18F 86 D6 88 D0 D4 10 0D 30 30 86 C4 AB 47 C3>> %temp%.\t1.src
for %%? in (rip 180 g w q) do echo %%?>> %temp%.\t1.src
echo SET %%1=XX XX XX XX> %temp%.\t2.bat
DEBUG %temp%.\t2.bat < %temp%.\t1.src > nul
call %temp%.\t2.bat _
%0 GoTo parse %_% MM DD YC YY
arse
set %7=%3
shift
if not "%7"=="" goto parse
for %%? in (t1.src t2.bat) do del %temp%.\%%?
set _=
IF !==!%1 ECHO USAGE: %0 date
IF !==!%1 ECHO Prepends 'date' to every filename in the current
directory
IF !==!%1 GOTO OUT
SET _=%TEMP%.\$.BAT
LFNFOR ON>%_%
FOR %%_ IN (*.*) DO ECHO REN "%%_" "%1%%_">>%_%
LFNFOR OFF
FOR %%_ IN (CALL DEL) DO %%_ %_%
SET _=
:OUT
I am trying to create a batch file which will append the date to a
series of file that are moved from another folder. So there will need
to be the use of wildcards for the files - as the filenames will vary.
The batch sequence below is what I have so far - the problem is I did
not write this myself - I am very new to batch and as you can see the
second section of the batch - the bit that actualy does the renaming
was designed for the user to input the desired date when calling the
batch from the run or command line.
What I am trying to do is get this second portion to accept the output
of the first section of the batch - the first section creates the time
/ date reference as the input. The porblem seems to be all the
associated viariables - any help would be appreciated.
This needs to run on both 2000 and NT4
Regards
Alex Tanner
The batch is as follows:
if "%1"=="GoTo" goto %2
echo e180 BF 07 01 B4 04 CD 1A E8 02 00 89 CA E8 00 00> %temp%.\t1.src
echo e18F 86 D6 88 D0 D4 10 0D 30 30 86 C4 AB 47 C3>> %temp%.\t1.src
for %%? in (rip 180 g w q) do echo %%?>> %temp%.\t1.src
echo SET %%1=XX XX XX XX> %temp%.\t2.bat
DEBUG %temp%.\t2.bat < %temp%.\t1.src > nul
call %temp%.\t2.bat _
%0 GoTo parse %_% MM DD YC YY
arse
set %7=%3
shift
if not "%7"=="" goto parse
for %%? in (t1.src t2.bat) do del %temp%.\%%?
set _=
IF !==!%1 ECHO USAGE: %0 date
IF !==!%1 ECHO Prepends 'date' to every filename in the current
directory
IF !==!%1 GOTO OUT
SET _=%TEMP%.\$.BAT
LFNFOR ON>%_%
FOR %%_ IN (*.*) DO ECHO REN "%%_" "%1%%_">>%_%
LFNFOR OFF
FOR %%_ IN (CALL DEL) DO %%_ %_%
SET _=
:OUT