Eliminating Batch file intervention

Batch file runs but stops at every line and needs intervention to continue to next line.  It prompts for an ok click.  I want to eliminate the click.
Who is Participating?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Probably a "pause" statement in it.....

Post the code if this isnt it.....

gloyola1Author Commented:
regsvr32.exe "C:\Program Files\FCS\WSO\Components\wsCalculations.dll" -u
regsvr32.exe "C:\Program Files\FCS\WSO\Components\wsDataLoader.dll" -u
regsvr32.exe "C:\Program Files\FCS\WSO\Components\wsDEOAsset.dll" -u
regsvr32.exe /s /u "C:\Program Files\FCS\WSO\Components\wsCalculations.dll"
regsvr32.exe /s /u "C:\Program Files\FCS\WSO\Components\wsDataLoader.dll"
regsvr32.exe /s /u "C:\Program Files\FCS\WSO\Components\wsDEOAsset.dll"
IT Pros Agree: AI and Machine Learning Key

We’d all like to think our company’s data is well protected, but when you ask IT professionals they admit the data probably is not as safe as it could be.

gloyola1Author Commented:
I tested the above and it does not prompt after each line but I have a question.  Before it would prompt with the attached succeeded message after each registered command line letting you know that it succeeded now it does not.  How would you know it succeeded in registering the files.  I renamed one of the files I am registering to a file that does not exist and when I ran the batch file it ran with no errors.    
regsvr32.exe /s /u "C:\Program Files\FCS\WSO\Components\wsCalculations.dll">regsvr32.txt
regsvr32.exe /s /u "C:\Program Files\FCS\WSO\Components\wsDataLoader.dll" >>regsvr32.txt
regsvr32.exe /s /u "C:\Program Files\FCS\WSO\Components\wsDEOAsset.dll">>regsvr32.txt
notepad regsvr32.txt

Any output regarding faliures or successes should be in the .txt file....
Lee W, MVPTechnology and Business Process AdvisorCommented:
Actually, johnb6767 may be incorrect.  While it should log successful information, to record errors, you need to use 2>&1 / 2>>&1 at the end - like so:

regsvr32.exe /s /u "C:\Program Files\FCS\WSO\Components\wsCalculations.dll">regsvr32.txt 2>&1
regsvr32.exe /s /u "C:\Program Files\FCS\WSO\Components\wsDataLoader.dll" >>regsvr32.txt 2>>&1
regsvr32.exe /s /u "C:\Program Files\FCS\WSO\Components\wsDEOAsset.dll">>regsvr32.txt 2>>&1

Standard output is was gets redirected (less error messages) with just >>filename.txt.  standard error requires the parts I added.
gloyola1Author Commented:
I tried testing it creates a regsvr32.txt file but the file is empty.  
Have you tried placing one of the following immediately infront of each REGSVR32.EXE command?



   echo y|

as in the following examples:

   echo.|regsvr32.exe /s /u "C:\Program Files\FCS\WSO\Components\wsCalculations.dll">regsvr32.txt


   echo y|regsvr32.exe /s /u "C:\Program Files\FCS\WSO\Components\wsCalculations.dll">regsvr32.txt

Also, I fully advocate the use of '2>&1' to capture output from both STDIN and STDERR channels.
Yup. I was..... Sorry, was late and past my bedtime....  :)

Thanks for catching leew.....

Leew is on top of it... Just for giggles, if you are trying to automate this, are you trying to capture any errors in a central location, like a single server share?
Actually I don't think you will ever get an error message into that file because regsvr32.exe is not a console application and therefore does not use stdout or stderr. Any messages are displayed in a window that it creates, unless you specify /s (silent) in which case it doesn't display any message.

You could try checking ERRORLEVEL instead.

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial

How can you state "Leew is on top of it...." when Leew makes NO MENTION whatsoever of the original problem - that the asker's batch file stops at every line, or did Leew fix this problem in his code?

Redirecting output was never part of the original question. The asker has moved the goalpost and he should consider very carefully how he closes this question.


You have not acknowledged my earlier comment. I am left in the dark as to whether or not your batch file STILL stops at every line. If not, then what did you do to solve this problem?

BTW, I've changed my mind about the '2>&1'-thing... I prefer to use something like the following:

   1>>regsvr32.txt 2>>regsvr32.err

I also suggest using the following code after each regsvr command:

   if errorlevel 1 echo error registering Calculations.dll 1>regsvr32.txt 2>regsvr32.err

This way, you'll have your general logs in the .txt file and any errors in the .err file - just makes life easier if you need to procees any of these files further.

Sorry, I meant:

I also suggest using the following code after each regsvr command:

   regsvr32.exe /u "C:\Progra~1\FCS\WSO\Compon~1\wsCalculations.dll" 1>regsvr32.txt 2>regsvr32.err
   if errorlevel 1 echo error unregistering wsCalculations.dll >>regsvr32.err
By the way, doesn't the REGSVR32.EXE command use the '/u' switch instead of the '-u' switch?

(See my example above)

"How can you state "Leew is on top of it....""

If you have a problem, send me an email. I made a mistake, and was simply letting leew take over....
gloyola1Author Commented:
Thanks for the additional suggestion.  Using the  '2>&1' kept creating an empty log.  I agree with Klitos "because regsvr32.exe is not a console application and therefore does not use stdout or stderr".  I will test t0t0 suggestion and let you know.
Lee W, MVPTechnology and Business Process AdvisorCommented:
I was just throwing out that the redirection was incomplete.  

I think I misremembered the command being run as thinking of REG and not REGSVR32... If the output doesn't go to the console, it won't matter what/how you redirect.
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Server Software

From novice to tech pro — start learning today.