Re: Same Batch file paused on some PC but not all

Tech-Archive recommends: Fix windows errors by optimizing your registry

From: Lawrence (Lawrence_at_discussions.microsoft.com)
Date: 12/03/04


Date: Fri, 3 Dec 2004 01:47:02 -0800

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 ?

"Pegasus (MVP)" wrote:

> 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
>
> "Lawrence" <Lawrence@discussions.microsoft.com> wrote in message
> news:B25F11D4-622D-4F1F-870C-DD8BD79C72CF@microsoft.com...
> > 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
> > :end
> > --------------------------------------------------------------------------
> -----------------
> >
> >
> > "Pegasus (MVP)" wrote:
> >
> > >
> > > "Lawrence" <Lawrence@discussions.microsoft.com> wrote in message
> > > news:4A88F751-F48D-4BE8-ABCF-688A45092C48@microsoft.com...
> > > > 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?
> > >
> > >
> > >
>
>
>



Relevant Pages

  • Re: Subst question
    ... > In a batch file, the @ symbol at the beginning of a line will hide the ... which you can see at a command prompt when you type ... > also limit it to one easily if you type in: echo %OS% ... is this say if the OS is NOT Windows NTgo to logoff or IS Windows ...
    (microsoft.public.scripting.vbscript)
  • Re: Using OR in Scripting?
    ... the end of the batch file. ... echo Found ... its for a logon .bat script. ... and use 2 GOTO ...
    (microsoft.public.windows.server.scripting)
  • Re: How to program Enable, Disable drivers?
    ... goto Start ... Use this batch file to enable or disable a device ... setlocal enabledelayedexpansion ... echo Syntax: Device enable / disable ...
    (microsoft.public.windowsxp.general)
  • Re: Persisting env vars in cmd windows
    ... The help text for the command you question goes like this: ... format by typing this: echo %date% ... If you don't then the batch file will fail. ... echo:: ERROR ERROR ERROR ERROR ...
    (microsoft.public.win2000.general)
  • Re: Win2000 Printing Nightmare
    ... Purge the print spooler, to do so at a command prompt issue the ... You can make a small batch file to do the above job, ... @echo off ... ping localhost -n 4> nul ...
    (microsoft.public.win2000.file_system)