none
Trying to run a setup.exe in BAT file. RRS feed

  • Question

  • I have a setup.exe file that I want to use to install a Dell Webcam application.
    The switch is as follows:
    setup.exe /s
    Simple.
    When I add the files to MDT and run the setup.exe /s nothing happens, and no error
    in the Final Summary screen.
    I decided to instead first copy the folder over to C: on the target machine, then run the setup.
    It copies the folder, and then MDT finishes with zero errors. If I then go to that folder and run the setup.exe /s in a run box, it runs silently as it should, but it will not copy and run the file.

    Here is the text in my batch file:

    @echo on

    robocopy \\mdtserver\share\Dell_Webcam C:\DellWebcam /e /np /nfl /ndl /njh /njs /nc /ns
    cd C:\DellWebcam
    START C:\DellWebcam\setup.exe /s

    Also, /S or     /S /v/qn works, manually. I can't get it to run through MDT. I only know of batch files and am not familiar at all the Powershell or any other methods to run exe files. I use this above method for copying and installing other setups just fine. Am I missing something here?

    Monday, December 5, 2016 6:41 PM

Answers

  • fyi, you werent using start properly.  using start without a "/w" tells it to initiate the EXE and continue the script without waiting for it to complete.  Here is an example of using a start in a batch properly.

    start /w "" "%~dp0setup.exe" /s

    %~dp0 => is replaced with the FULL PATH upon execution of batch.
    /w => tells start to wait for exe to complete before moving on.

    /BG


    -BrianG (http://supportishere.com)

    • Marked as answer by the1rickster Thursday, December 8, 2016 5:23 PM
    Thursday, December 8, 2016 3:11 AM
  • Close Brian. What it took for me was a batch file written as:

    robocopy \\mdtserver\share\Dell_Webcam C:\DellWebcam /e /np /nfl /ndl /njh /njs /nc /ns
    cd c:\dellwebcam
    start /WAIT c:\dellwebcam\setup.exe /s /w

    I had been using the 'start /wait' but I added a /w at the very end. Now it installs completely. Thanks!!! These installs are getting hairier and hairier.

    • Marked as answer by the1rickster Thursday, December 8, 2016 5:25 PM
    Thursday, December 8, 2016 5:25 PM

All replies

  • How about dropping the "START" in START C:\DellWebcam\setup.exe /s
    Monday, December 5, 2016 6:52 PM
  • I removed the START and also removed the cd c:\dellwebcam

    Each time it copies the folder but does not run the setup.exe

    Monday, December 5, 2016 6:58 PM
  • I ran one batch file to copy the folder over and it succeeded. Then I created another test batch file which only has
    C:\DellWebcam\setup.exe /s   and it does nothing.
    Monday, December 5, 2016 7:09 PM
  • Hey! Have you seen this?

    https://community.spiceworks.com/topic/422098-deploy-dell-webcam-software-through-mdt-2012

    Try wrapping your last line in "C:\DellWebcam\setup.exe /s" in quotations....

    Wednesday, December 7, 2016 1:54 PM
  • This scenario works:
    From the desktop of the target machine, C$ to the Mdtserver and running the batch file, the folder gets copied and kicks off the install. Adding the batch to MDT, the folder copies but no-go on the install running. Immediately after the copy, about 3 seconds, I get the white Final Summary screen with zero errors/warnings. Regardless of the syntax - quotes, no quotes, /s, or /S /v/qn, the setup does not run through MDT but does manually running the bat from the target desktop.
    Wednesday, December 7, 2016 4:06 PM
  • Why copy it down when you can create it as an application and run it directly? 

    I have several EXEs for our environment and I create an app with the appropriate switches...

    Wednesday, December 7, 2016 5:51 PM
  • I don't have to copy it, it was just something else to try. Whether I run it from the server, or from the target machine, it fails to run. At least I can see that it's copying over. Either way it doesn't run in MDT. It does run if I C$ to the server and run the batch manually.
    Wednesday, December 7, 2016 5:54 PM
  • Did you try it like this?


    If this post is helpful please vote it as Helpful or click Mark for answer.

    Wednesday, December 7, 2016 9:52 PM
  • Here's a simple vb wrapper you can try, at least you'll get some logging with the wrapper.

    <job id="Install-DellWebCam">
    <script language="VBScript" src="..\..\scripts\ZTIUtility.vbs"/>
    <script language="VBScript"> 
    
    '//----------------------------------------------------------------------------
    '// Purpose: Used to install Dell Web Camera software
    '// Usage: cscript Install-DellWebCam.wsf [/debug:true]
    '// Version: 1.0 - December 07, 2016
    '// Notes: 
    '//----------------------------------------------------------------------------
    
    '//----------------------------------------------------------------------------
    '// Global constant and variable declarations
    '//---------------------------------------------------------------------------- 
    
    Option Explicit 
    
    Dim iRetVal 
    
    '//----------------------------------------------------------------------------
    '// End declarations
    '//---------------------------------------------------------------------------- 
    
    '//----------------------------------------------------------------------------
    '// Main routine
    '//---------------------------------------------------------------------------- 
    
    On Error Resume Next
    iRetVal = ZTIProcess
    ProcessResults iRetVal
    On Error Goto 0 
    
    '//---------------------------------------------------------------------------
    '//
    '// Function: ZTIProcess()
    '//
    '// Input: None
    '// 
    '// Return: Success - 0
    '// Failure - non-zero
    '//
    '// Purpose: Perform main ZTI processing
    '// 
    '//---------------------------------------------------------------------------
    Function ZTIProcess() 
    
    
    	oLogging.CreateEntry "Install-DellWebCam: Starting Dell Web Camera installation", LogTypeInfo	
    
    	' Disable Zone Checks
    	oEnv("SEE_MASK_NOZONECHECKS") = 1 
    
    	
    	' Install Web Camera software
    	iRetVal = oUtility.RunWithHeartbeat(oUtility.ScriptDir & "\Installer\Setup.exe /s")
    	
    	if (iRetVal = 0) or (iRetVal = 3010) then
    		ZTIProcess = Success 
    	Else 
    		ZTIProcess = Failure
    		oLogging.CreateEntry "Install-DellWebCam: Error installing Application Plugin. Check the log " & oUtility.LocalRootPath & "\SMSOSD\OSDLOGS\Install-DellWebCam.log", LogTypeWarning
    	End If
    
    
    	' Enable Zone Checks
    	oEnv.Remove("SEE_MASK_NOZONECHECKS")
    
    	oLogging.CreateEntry "Install-DellWebCam: Return code from command = " & iRetVal, LogTypeInfo
    	oLogging.CreateEntry "Install-DellWebCam: Finished Dell Web Cam installation", LogTypeInfo	
    	
    End Function 
    
    </script>
    </job>


    If this post is helpful please vote it as Helpful or click Mark for answer.


    • Edited by Dan_Vega Thursday, December 8, 2016 2:42 PM
    Wednesday, December 7, 2016 9:58 PM
  • fyi, you werent using start properly.  using start without a "/w" tells it to initiate the EXE and continue the script without waiting for it to complete.  Here is an example of using a start in a batch properly.

    start /w "" "%~dp0setup.exe" /s

    %~dp0 => is replaced with the FULL PATH upon execution of batch.
    /w => tells start to wait for exe to complete before moving on.

    /BG


    -BrianG (http://supportishere.com)

    • Marked as answer by the1rickster Thursday, December 8, 2016 5:23 PM
    Thursday, December 8, 2016 3:11 AM
  • Exactly like that.
    Thursday, December 8, 2016 2:51 PM
  • Close Brian. What it took for me was a batch file written as:

    robocopy \\mdtserver\share\Dell_Webcam C:\DellWebcam /e /np /nfl /ndl /njh /njs /nc /ns
    cd c:\dellwebcam
    start /WAIT c:\dellwebcam\setup.exe /s /w

    I had been using the 'start /wait' but I added a /w at the very end. Now it installs completely. Thanks!!! These installs are getting hairier and hairier.

    • Marked as answer by the1rickster Thursday, December 8, 2016 5:25 PM
    Thursday, December 8, 2016 5:25 PM
  • This scenario works:
    From the desktop of the target machine, C$ to the Mdtserver and running the batch file, the folder gets copied and kicks off the install. Adding the batch to MDT, the folder copies but no-go on the install running. Immediately after the copy, about 3 seconds, I get the white Final Summary screen with zero errors/warnings. Regardless of the syntax - quotes, no quotes, /s, or /S /v/qn, the setup does not run through MDT but does manually running the bat from the target desktop.
    Any suggestion on this. I am also facing the same issue.
    Friday, May 11, 2018 3:28 AM
  • What application are you trying to install silently....and what have you tried so far?
    Do any batch commands run if you do them manually on the target pc?
    Friday, May 11, 2018 2:07 PM