Difference in setupcomplete.cmd ?

Discussion in 'Scripting' started by ShyFx, Mar 17, 2014.

  1. ShyFx

    ShyFx MDL Novice

    Jan 11, 2013
    23
    8
    0
    Hi.
    I thought to clean up the various setup complete script I have saved, but i
    see that there be a difference in someone setup complete script. I'm not sure if there is any difference in how effective they are or what. For example, inside one script:

    @echo off
    pushd %~dp0

    :Microsoft Security Essentials
    echo Installing Microsoft Security Essentials
    %WINDIR%\Setup\Scripts\MSEInstall_x64.exe /s /runwgacheck /o

    :CLEANUP
    cd /d "C:\"
    rd /S /Q %WINDIR%\Setup\Scripts

    And in another

    @echo off
    pushd %~dp0

    start /wait %WINDIR%\Setup\Scripts\MSEInstall_x64.exe /s /runwgacheck /o

    :CLEANUP
    cd /d "C:\"
    rd /S /Q %WINDIR%\Setup\Scripts


    I used Microsoft Security Essentials as an example here, but the difference in the layout of these looks different..
    What is best to use and works on Windows from Vista to Windows 8.1, or if anyone has almost finished script that is better and install this before at the end with extra functionality ?
     
  2. murphy78

    murphy78 MDL DISM Enthusiast

    Nov 18, 2012
    7,389
    11,614
    240
    I would avoid using the start /wait method unless you are also using other options such as /high or /b
    start does not need to be in the equation at all unless you are using it for a specific purpose such as allowing a program to run while you are doing other things (in the background)

    Start is a program that runs other programs. Using the /wait option without the other options is pointless.
     
  3. ShyFx

    ShyFx MDL Novice

    Jan 11, 2013
    23
    8
    0
    Thanks for the reply:)

    So you say that with the start / wait methods, thats overlap each other. For example, it starts to install the next before it finishes the current update?
    How setupcomplete script do you use, or do you have some good examples?
    i try and understand things better, but is not so simple when I'm not so good at explaining things in English :g:
     
  4. s1ave77

    s1ave77 Has left at his own request

    Aug 15, 2012
    16,104
    24,378
    340
    Using setupcomplete to create a RunOnceEx key in registry to start my install script one reboot later, as i found this is more reliable. The actual install script looks like the first example in your first post. No need for the /wait switch for that moment it runs.
     
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...