G
Guest
Hello,
Line bye line, can someone please tell me what is going on in this bat file.
I not sure what is going on in each step. I have a general understanding of
what the bat is doing, but have to test it on a Windows2000/XP platform and
want to completely understand it first. The commands and variables. It is
currently running on a Windows 98. The user also runs this from a command
prompt. This bat file is named C. This is what what the user types at the
command prompt. "c 05212007". The number following c is a folder created
prior to running this script.
@echo off
cls
if "%1"=="" goto bad
if not exist g:\%1\*.* goto bad
dir g:\%1\*.txt /on > c:\windows\temp\dir.xls
g:
cd\%1
echo Record Counts: > c:\windows\temp\records.txt
for %%1 in (*.txt) do find /i /c "ACCT#" %%1 >> c:\windows\temp\records.txt
c:
cd\windows\temp
"c:\program files\microsoft office\office\excel.exe" records.txt dir.xls
formula.xls
goto end
:bad
echo You must enter a valid G drive directory format(MMDDYYYY) Example: %0
01192006
:end
Line bye line, can someone please tell me what is going on in this bat file.
I not sure what is going on in each step. I have a general understanding of
what the bat is doing, but have to test it on a Windows2000/XP platform and
want to completely understand it first. The commands and variables. It is
currently running on a Windows 98. The user also runs this from a command
prompt. This bat file is named C. This is what what the user types at the
command prompt. "c 05212007". The number following c is a folder created
prior to running this script.
@echo off
cls
if "%1"=="" goto bad
if not exist g:\%1\*.* goto bad
dir g:\%1\*.txt /on > c:\windows\temp\dir.xls
g:
cd\%1
echo Record Counts: > c:\windows\temp\records.txt
for %%1 in (*.txt) do find /i /c "ACCT#" %%1 >> c:\windows\temp\records.txt
c:
cd\windows\temp
"c:\program files\microsoft office\office\excel.exe" records.txt dir.xls
formula.xls
goto end
:bad
echo You must enter a valid G drive directory format(MMDDYYYY) Example: %0
01192006
:end