Same Batch file paused on some PC but not all

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Running the same DOS batch file on many PC, most PC will run till the end,
but few need press {Enter} key to make the batch file goes on.

Any clue what's the cause and how to fix it ?

Thank you.
 
Lawrence said:
Running the same DOS batch file on many PC, most PC will run till the end,
but few need press {Enter} key to make the batch file goes on.

Any clue what's the cause and how to fix it ?

Thank you.

- What does the batch file look like?
- What is the operating system of your PCs?
 
The batch file is : (the content in between the dotted line)

-------------------------------------------------------------------------------------------
SET ND=\\Network_File_Server\NETLOGON
SET FD=\\Network_File_Server\FILEDIST

C:\AppDir\W2KSP4_src\LOGTIME.exe %wsid% > C:\AppDir\W2KSP4_src\W2KSP4_log

cscript C:\AppDir\W2KSP4_src\delete_file.vbs

echo Check window current verion
C:\AppDir\W2KSP4_src\LOGTIME.exe "Check window current version" >>
C:\AppDir\W2KSP4_src\W2KSP4_log
regedit /e C:\AppDir\W2KSP4_src\w2ksp4_winver.txt
"HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion"

TYPE C:\AppDir\W2KSP4_src\w2ksp4_winver.txt | FIND /c "Service Pack 4" > NUL
IF NOT %ERRORLEVEL%==1 goto no_need_to_install_SP4

IF NOT EXIST C:\AppDir\W2KSP4_src\compfile.vbs goto file_not_match
IF NOT EXIST C:\AppDir\W2KSP4_src\LOGTIME.exe goto file_not_match
IF NOT EXIST C:\AppDir\W2KSP4_src\delete_file.vbs goto file_not_match
IF NOT EXIST C:\AppDir\W2KSP4_src\kill.vbs goto file_not_match
IF NOT EXIST C:\AppDir\W2KSP4_src\Prompt1.exe goto file_not_match
IF NOT EXIST C:\AppDir\W2KSP4_src\Prompt2.exe goto file_not_match

cscript C:\AppDir\W2KSP4_src\compfile.vbs
%FD%\package\W2KSP4\W2KSP4_src\W2KSP4_tw.exe
C:\AppDir\W2KSP4_src\W2KSP4_tw.exe
if %errorlevel%==1 goto file_match
if NOT %errorlevel%==1 goto file_not_match

:file_not_match
echo File not match, W2KSP4_tw.exe
C:\AppDir\W2KSP4_src\LOGTIME.exe "File not match W2KSP4_tw.exe" >>
C:\AppDir\W2KSP4_src\W2KSP4_log
Type C:\AppDir\W2KSP4_src\W2KSP4_log >> %FD%\cfg\%wsid%\W2KSP4_log
C:\AppDir\W2KSP4_src\Prompt2.exe
goto END
:end

:file_match
Start C:\AppDir\W2KSP4_src\Prompt1.exe
echo File match, W2KSP4_tw.exe
C:\AppDir\W2KSP4_src\LOGTIME.exe "File match W2KSP4_tw.exe" >>
C:\AppDir\W2KSP4_src\W2KSP4_log
:end

echo Execute Install W2KSP4_tw.exe - Start
C:\AppDir\W2KSP4_src\LOGTIME.exe "Start install W2KSP4_tw.exe" >>
C:\AppDir\W2KSP4_src\W2KSP4_log
REM C:\AppDir\W2KSP4_src\w2ksp4_tw.exe -u -o -z -q
REM NO BACKUP
C:\AppDir\W2KSP4_src\w2ksp4_tw.exe -u -o -z -q -n
echo Execute Install W2KSP4_tw.exe - Finish
C:\AppDir\W2KSP4_src\LOGTIME.exe "Finish install W2KSP4_tw.exe" >>
C:\AppDir\W2KSP4_src\W2KSP4_log

cscript C:\AppDir\W2KSP4_src\file_exist.vbs
if %errorlevel%==1 goto install_success
if NOT %errorlevel%==1 goto install_fail

:install_fail
C:\AppDir\W2KSP4_src\LOGTIME.exe W2KSP4_fail >>
C:\AppDir\W2KSP4_src\W2KSP4_log
Type C:\AppDir\W2KSP4_src\W2KSP4_log >> %FD%\cfg\%wsid%\W2KSP4_log

cscript C:\AppDir\W2KSP4_src\kill.vbs Prompt1.exe
C:\AppDir\W2KSP4_src\Prompt2.exe
goto CHKPT2
:end

:install_success
C:\AppDir\W2KSP4_src\delete_file.vbs
TYPE C:\AppDir\W2KSP4_src\W2KSP4_log >> %FD%\cfg\%wsid%\W2KSP4_log
goto CHKPT1
:end

:no_need_to_install_SP4
IF NOT EXIST %FD%\cfg\%wsid%\W2KSP4_log
C:\AppDir\W2KSP4_src\LOGTIME.exe "Already W2KSP4" >>
C:\AppDir\W2KSP4_src\W2KSP4_log
IF EXIST %FD%\cfg\%wsid%\W2KSP4_log TYPE %FD%\cfg\%wsid%\W2KSP4_log >
C:\AppDir\W2KSP4_src\W2KSP4_log
C:\AppDir\W2KSP4_src\LOGTIME.exe W2KSP4_success >>
C:\AppDir\W2KSP4_src\W2KSP4_log
Type C:\AppDir\W2KSP4_src\W2KSP4_log >> %FD%\cfg\%wsid%\W2KSP4
goto CHKPT2
:end

:CHKPT1
echo end
C:\AppDir\reboot.exe
:end

:CHKPT2
echo end
goto END
:en
 
Those PCs that require Enter to be pressed, which is the
last line they execute?

By the way, you can simplify your code by making use
of some advanced Win2000/XP batch file commands.
Your lines

C:\AppDir\W2KSP4_src\W2KSP4_tw.exe
if %errorlevel%==1 goto file_match
if NOT %errorlevel%==1 goto file_not_match
:file_not_match
echo File not match, W2KSP4_tw.exe

are equivalent to

C:\AppDir\W2KSP4_src\W2KSP4_tw.exe || goto file_match
echo File not match, W2KSP4_tw.exe

|| means: execute this if the errorlevel was > 0
&& means: execute this if the errorlevel was = 0
 
It's not at the last line, and when running other batch files, even with one
as simple as :
copy path\file_a d:\detination_path
copy path\file_b d:\detination_path
copy path\file_c d:\detination_path
copy path\file_d d:\detination_path
copy path\file_e d:\detination_path
copy path\file_f d:\detination_path
copy path\file_g d:\detination_path
On some computers, sometimes (not always even on the same PC) need to press
a key to make the batch file goes on too.
Any idea ? or it's just a bug on the DOS prompt under Windows 2000 ?
 
I have not seen this phenomenon on any of the the machines
that I have worked on. Unfortunately this means that I am unable
to offer any further assistance. Perhaps this newsgroup can help
you: alt.msdos.batch.nt
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top