script is not working when saved as bat

I am trying to install a .msi application using a batch file. I typed the below command in CMD and hit enter then the application got installed. Then i create a batch script with the same command and when i run the script it is not installing. i typed the same below command in notepad and saved it as .bat but it does not work.  

msiexec /q /i C:\CB\installer_vista_win7_win8-64-3.1.0.150.msi COMPANY_CODE=XXXXXXXXXXXXXXXXX GROUP_NAME=Advanced-Default

Open in new window

Debrata 1Asked:
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.

NVITCommented:
What errors or messages do you get?
0
QlemoBatchelor, Developer and EE Topic AdvisorCommented:
Run a prompt, and execute the batch from there to see error messages, instead of starting from Explorer directly - if not already done that way.
0
Debrata 1Author Commented:
I don't get no error it just doesn't install or where do i check the error ?
1
Cloud Class® Course: Python 3 Fundamentals

This course will teach participants about installing and configuring Python, syntax, importing, statements, types, strings, booleans, files, lists, tuples, comprehensions, functions, and classes.

Gerwin Jansen, EE MVETopic Advisor Commented:
Add a pause statement as a last line in your .bat file. That may show you what is going wrong.

How exactly do you run the script? Double click in Explorer? Schedule? Type in cmd window?
0
Bill PrewCommented:
Make sure you didn't save the BAT file as MSIEXEC.BAT, that won't work, it will loop calling itself when you run it.  Give a name that isn't any existing command already, perhaps "MYCBINSTALL.BAT" or something else unique.


»bp
0
Debrata 1Author Commented:
Currently i am double clicking it from the desktop but after i make sure i have a solid script my plan is to make a GPO log on script.
Thanks.
0
QlemoBatchelor, Developer and EE Topic AdvisorCommented:
As stated, either open up a Command Prompt window, and execute the batch file there (e.g. by dragging it from Explorer into the prompt window), or add a pause at the end of the script. Both will allow you to see error messages and command output.
1
Debrata 1Author Commented:
I have attached what i am getting when  added pause at the end of the script. when i press a key CMD closes and nothing happens.

Thanks.Install.PNG
1
QlemoBatchelor, Developer and EE Topic AdvisorCommented:
So the batch works fine, not spitting out any error. There should be no difference between using the batch and typing the command. Can you try if it works in an Admin Command Prompt?
It might also help troubleshooting if you omit the /q from msiexec.
0
Gerwin Jansen, EE MVETopic Advisor Commented:
You could add the following line above the pause command:

echo %ERRORLEVEL%

It could give you the 'result' of the previous command. 0 means it ran OK, some other number would mean something went wrong.
0
Debrata 1Author Commented:
Does this mean there is an error
Script3.PNG
0
David Johnson, CD, MVPOwnerCommented:
1603 is a generic error
one of the reasons you get it is because the application is already installed
https://support.microsoft.com/en-ca/help/834484/you-receive-an-error-1603-a-fatal-error-occurred-during-installation-e
1

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
Gerwin Jansen, EE MVETopic Advisor Commented:
yes that is an error, as I said 0 (zero) means is everything OK, other numbers are not
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
Scripting Languages

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.