aravind anche
asked on
command prompt wont close after executing batch file
I have a batch file to install MSoffice in MDT. After installing MSOffice command prompt screen wont go away. So the Lite touch installation wont go away and deployment stuck there.
Here is the batch file:
@echo off
ECHO "Please wait, Installing Microsoft Office Applications 2010"
ECHO .
ECHO .
@echo off
Echo "Copying Desktop MSP to Updates"
md "C:\MSOCache\All Users"
copy "K:\APPS\MSOffice2010ENT\M ST\2010-la ptop.msp" "C:\MSOCache\All Users\2010-laptop.msp"
cls
echo "Installing Office 2010 Enterprise"
"K:\APPS\MSOffice2010ENT\s etup.exe" /adminfile "C:\MSOCache\All Users\2010-laptop.msp" /Config "K:\APPS\MSOffice2010ENT\M ST\config- install.xm l"
I tried keeping end and exit at the end but then batch file wont run. also i tried timeout out too
Thanks
Here is the batch file:
@echo off
ECHO "Please wait, Installing Microsoft Office Applications 2010"
ECHO .
ECHO .
@echo off
Echo "Copying Desktop MSP to Updates"
md "C:\MSOCache\All Users"
copy "K:\APPS\MSOffice2010ENT\M
cls
echo "Installing Office 2010 Enterprise"
"K:\APPS\MSOffice2010ENT\s
I tried keeping end and exit at the end but then batch file wont run. also i tried timeout out too
Thanks
ASKER
Thanks,
I tried that too
I added start and also start "" at the start. When I do that the batch file wont run.
start "setup.exe" /adminfile "C:\MSOCache\All Users\2010-laptop.msp" /Config "config-install.xml"
i changed the command as I imported the application to MDT and they are in same folder now. Sorry i would have mentioned that in the question.
I tried that too
I added start and also start "" at the start. When I do that the batch file wont run.
start "setup.exe" /adminfile "C:\MSOCache\All Users\2010-laptop.msp" /Config "config-install.xml"
i changed the command as I imported the application to MDT and they are in same folder now. Sorry i would have mentioned that in the question.
try the following:
if that doesn't work you can create another batch to call your install batch in the background:
start "Install MS OFFICE 2010" /D "K:\APPS\MSOffice2010ENT\" "setup.exe" "/adminfile C:\MSOCache\All Users\2010-laptop.msp /Config K:\APPS\MSOffice2010ENT\MST\config-install.xml"
if that doesn't work you can create another batch to call your install batch in the background:
START /B CMD /C CALL "install.bat" >NUL 2>&1
ASKER
Thanks,
Did that nothing happened.
setupfile, config file are in application bundle.
2010-laptop.msp is inside MDT application and also in ALL users folder.
Thanks
Did that nothing happened.
setupfile, config file are in application bundle.
2010-laptop.msp is inside MDT application and also in ALL users folder.
Thanks
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Additionally, if you want to verify the output, you can add PAUSE at the end of your script, and it will add a "Press any key to continue . . . " prompt at the end.
ASKER
Thanks
David:Exit did not work
David:Exit did not work
Are you starting the batch file from another batch file? If so use "call" to start it, for example "Call BatchfileName.bet"
ASKER
Thanks David,
It did close but it took around 25 minutes, Is there anything I can add?
It did close but it took around 25 minutes, Is there anything I can add?
Dj 3094,
Like I said earlier, try adding PAUSE on the line before EXIT.
Like I said earlier, try adding PAUSE on the line before EXIT.
Hi,
I'm not going to encourage *anyone* to use a BAT file.
Instead I am going to ask why are you copying the MSP file locally to the MSO cache? That is not in any description of how to install Office.
The MS method is to put your MSP files in the Updates folder of the Office source directory.
Ref: https://blogs.windows.com/itpro/2010/07/01/your-adding-office-2010-to-mdt-2010-environment-questions-answered/#xSQUeYJ5eLE7ETiR.97
or
Ref: https://blog.augustoalvarez.com.ar/2011/01/16/deploying-windows-7-office-2010-using-microsoft-deployment-toolkit-mdt-2010-part-ii/
You then put the XMLconfig in the root and that's it.
In MDT your installer becomes "Setup.exe". No BAT file required.
It's time to delete your batch files.
Mike
I'm not going to encourage *anyone* to use a BAT file.
Instead I am going to ask why are you copying the MSP file locally to the MSO cache? That is not in any description of how to install Office.
The MS method is to put your MSP files in the Updates folder of the Office source directory.
Ref: https://blogs.windows.com/itpro/2010/07/01/your-adding-office-2010-to-mdt-2010-environment-questions-answered/#xSQUeYJ5eLE7ETiR.97
or
Ref: https://blog.augustoalvarez.com.ar/2011/01/16/deploying-windows-7-office-2010-using-microsoft-deployment-toolkit-mdt-2010-part-ii/
You then put the XMLconfig in the root and that's it.
In MDT your installer becomes "Setup.exe". No BAT file required.
It's time to delete your batch files.
Mike
add a start before the executing call.
EG:
"K:\APPS\MSOffice2010ENT\s
becomes
Open in new window
to make the process kick off and not have the bat file wait for completion.