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.
gloyola1Asked:
Who is Participating?
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.

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

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

0
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
0
johnb6767Commented:
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"
0
Get your problem seen by more experts

Be seen. Boost your question’s priority for more expert views and faster solutions

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.    
Doc1.doc
0
johnb6767Commented:
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....
0
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.
0
gloyola1Author Commented:
I tried testing it creates a regsvr32.txt file but the file is empty.  
0
t0t0Commented:
Have you tried placing one of the following immediately infront of each REGSVR32.EXE command?


   echo.|

or

   echo y|


as in the following examples:


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

or

   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.
0
johnb6767Commented:
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?
0
KlitosCommented:
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.
0

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
t0t0Commented:
johnb6767

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.



gloyola1

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
   etc....

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.



 
0
t0t0Commented:
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
 
   etc....
0
t0t0Commented:
By the way, doesn't the REGSVR32.EXE command use the '/u' switch instead of the '-u' switch?

(See my example above)
0
johnb6767Commented:
@t0t0

"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....
0
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.
0
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.
0
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.

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.