Jump to content

About the Setupcomplete.cmd


Recommended Posts

Ok so I think I kind of got this working now using the following code



@echo off

setlocal enableextensions disabledelayedexpansion

(set CDROM=)

for %%i in (C D E F G H I J K L M N O P Q R S T U V W X Y Z) do (if exist %%i:\sources\install.wim set "CDROM=%%i:")

if not defined CDROM goto :eof
start /wait %CDROM%\Updates\IE9-Windows7-x64-enu.exe /passive /norestart /update-no
start /wait wusa.exe %CDROM%\Updates\AMD64-all-ie9-windows6.1-kb2530548-x64.msu /quiet /norestart /nobackup
start /wait wusa.exe %CDROM%\Updates\AMD64-all-ie9-windows6.1-kb2559049-x64.msu /quiet /nobackup /norestart
start /wait wusa.exe %CDROM%\Updates\AMD64-all-windows6.1-kb2533552.msu /quiet /norestart /nobackup
start /wait %CDROM%\Updates\AMD64_X86-all-silverlight.exe /q

del %0

What I need now is some way of knowing what its doing right now. Some sort of progress bar. For some of the apps it does like IE9 but not the windows updates. Back with windows xp the /passive command would do this but that does not work with updates for vista going forward unless its a service pack. Any ideas how to create a progress bar of some sort that can go for each app?

Link to comment
Share on other sites


probably in something like this format.

my items arent so much starting as they are waiting for you to press any key, and then subsequently close the app. but you should get the idea. Maybe echo something more useful and take out the pauses as they only exist because so you can step through it. Not exactly a progress bar proper, but will still inform the user of what is occuring.

@echo off
cmd /c echo first item starting...
pause
start /wait notepad.exe
echo first item complete...
pause
echo second item starting...
pause
start /wait iexplore.exe
echo second item complete...

Edited by iamtheky
Link to comment
Share on other sites

probably in something like this format.

my items arent so much starting as they are waiting for you to press any key, and then subsequently close the app. but you should get the idea. Maybe echo something more useful and take out the pauses as they only exist because so you can step through it. Not exactly a progress bar proper, but will still inform the user of what is occuring.

@echo off
cmd /c echo first item starting...
pause
start /wait notepad.exe
echo first item complete...
pause
echo second item starting...
pause
start /wait iexplore.exe
echo second item complete...

So what in the code keeps the dos box open or open a new one? My problem is I dont see the dos box at all when this is going on. Most of my code I got from various websites. I totally suck at programming which is why this is so hard for me.

Link to comment
Share on other sites

the switch on cmd.exe, cmd /c = keeps it open till you are done with it and then closes it automatically. If you are having to troubleshoot maybe cmd /k as that should cause it to persist (though you will end up with many persistent cmd windows if you use cmd /k in multiple places)

maybe change your lines to - 'Start /wait cmd /c foo.exe'

Edited by iamtheky
Link to comment
Share on other sites

Ok so I think I kind of got this working now using the following code



@echo off

setlocal enableextensions disabledelayedexpansion

(set CDROM=)

for %%i in (C D E F G H I J K L M N O P Q R S T U V W X Y Z) do (if exist %%i:\sources\install.wim set "CDROM=%%i:")

if not defined CDROM goto :eof
start /wait %CDROM%\Updates\IE9-Windows7-x64-enu.exe /passive /norestart /update-no
start /wait wusa.exe %CDROM%\Updates\AMD64-all-ie9-windows6.1-kb2530548-x64.msu /quiet /norestart /nobackup
start /wait wusa.exe %CDROM%\Updates\AMD64-all-ie9-windows6.1-kb2559049-x64.msu /quiet /nobackup /norestart
start /wait wusa.exe %CDROM%\Updates\AMD64-all-windows6.1-kb2533552.msu /quiet /norestart /nobackup
start /wait %CDROM%\Updates\AMD64_X86-all-silverlight.exe /q

del %0

What I need now is some way of knowing what its doing right now. Some sort of progress bar. For some of the apps it does like IE9 but not the windows updates. Back with windows xp the /passive command would do this but that does not work with updates for vista going forward unless its a service pack. Any ideas how to create a progress bar of some sort that can go for each app?

may i know how you make your setupcomplete.cmd work in install.wim? i put a setupcomplete.cmd in intall,wim, but did not see after system finish installation.

Link to comment
Share on other sites

the switch on cmd.exe, cmd /c = keeps it open till you are done with it and then closes it automatically. If you are having to troubleshoot maybe cmd /k as that should cause it to persist (though you will end up with many persistent cmd windows if you use cmd /k in multiple places)

maybe change your lines to - 'Start /wait cmd /c foo.exe'

I got it working for the cmd to stay open but it does not show any text for it. Still trying to figure this part out. I will post back when I get closer to working it out.

Link to comment
Share on other sites

  • 2 weeks later...

the switch on cmd.exe, cmd /c = keeps it open till you are done with it and then closes it automatically. If you are having to troubleshoot maybe cmd /k as that should cause it to persist (though you will end up with many persistent cmd windows if you use cmd /k in multiple places)

maybe change your lines to - 'Start /wait cmd /c foo.exe'

I got it working for the cmd to stay open but it does not show any text for it. Still trying to figure this part out. I will post back when I get closer to working it out.

Hi gotenks98,

Any success with displaying text in cmd window? Also, I'm not much comfortable with batch files yet but I use a slightly modified version of your SetupComplete.cmd in the first post as follows:

@echo off

setlocal enableextensions disabledelayedexpansion

(set CDROM=)

for %%i in (C D E F G H I J K L M N O P Q R S T U V W X Y Z) do (if exist %%i:\Autounattend.xml set "CDROM=%%i:")

if not defined CDROM goto :eof
start /wait cmd /c wusa.exe %CDROM%\Updates\IE9-win7.msu /quiet /norestart /log:ie9logfile.txt
start /wait cmd /c wusa.exe %CDROM%\Updates\IE9-Windows6.1-KB2586448-x64.msu /quiet /norestart /nobackup
start /wait cmd /c wusa.exe %CDROM%\Updates\IE9-Windows6.1-KB2624899-x64.msu /quiet /norestart /nobackup
start /wait cmd /c wusa.exe %CDROM%\Updates\Windows6.1-KB2533552-x64.msu /quiet /norestart /nobackup
start /wait cmd /c %CDROM%\Updates\Silverlight.exe /q

del %0

It works OK (sort of...) and installs KB2533552, Silverlight and IE9 but without cumulative update KB2586448 and hotfix KB2624899. :o I can see empty CMD windows upon initialization of SetupComplete.cmd but since there is no text/progress bar, it's difficult to judge which app or update is being installed. My update history shows that installation of KB2624899 was cancelled (see: logfile attached). However, "About Internet Explorer" page looks as below. So, here are my guesses:

(i) Update KB2586448 is already inserted into IE9 since I use the latest "IE9-win7.msu" and update agent doesn't bother with installing it on top of already-installed package;

(ii) Update agent refuses to install hotfix KB2624899 because it's applied on special cases only. However, support article states that:

To apply this hotfix, you must have Internet Explorer security update 2586448 installed.
.

Now, I'm really confused!!! :o Since, as the image shows, I have it installed already...

VZUU9.jpg

WEDSB.jpg

And the last question: Is it possible to somehow suppress WUSA.exe information window during "Setupcomplete" ?!?

Thank you!

WindowsUpdate.zip

Edited by simurqq
Link to comment
Share on other sites

Still no text when I do this. Its starting to be more trouble than its worth at this point. I dont see why microsoft does not create reliable documentation on how to do this. Its like everytime they come out with a tool or something to help developers they half a** do it by either not putting a gui on it or make it too restrictive to the point where it just does not help at all. I would have loved to be able to use the first login commands for this but I could never get it working after at least 50 attempts on a 64-bit install.

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...