I'm trying to install a setup.exe via a batch file. Batch file also adds a registry key which works but the software is not installing. I can run the batch file locally on the machine and it works. This is how the batch file reads

@echo off
.\setup.exe /s /v/qn (I have tried it without .\ and it didn't work either)
 rem  set __COMPAT_LAYER=RunAsInvoker  
 REGEDIT.EXE  /S  "%~dp0\code.reg

setup.exe is not working but it does run the code.reg file. 
This is how I have distribution setup. 

Zip file contains, setup.exe, setup.bat and code.reg

0 Comments   [ + ] Show comments


  • This content is currently hidden from public view.
    Reason: Removed by member request
    For more information, visit our FAQ's.
Please log in to comment


Check "Don't prepend msiexec.exe" and remove .\ in front of setup.exe
Answered 07/18/2018 by: c.castellari
Orange Senior Belt

Please log in to comment
I have no idea about the KACE stuff, and i suspect that's not your 'real' code (since REGEDIT wouldn't work without the end quote), but I'd suggest you need:

1.  The full path to the setup.exe:
"%~dp0\setup.exe" /s /v/qn

2.  A quote at the end of the regedit command:
 REGEDIT.EXE /S "%~dp0\code.reg"

(....but that's all just a guess)

Answered 07/18/2018 by: captain_planet
Black Belt

Please log in to comment
The box for "Don't prepend msiexe.exe" needs to be checked.
If you leave that box unchecked, Kace will try and run your batch script using the msiexec.exe installer. Since you're running a .bat file and not a .msi file, this is going to cause problems.
Answered 07/18/2018 by: pbrandvold
Orange Belt

  • That didn't resolve the issue. I found when I deploy via script, I can install it using Windows Run As "logged in User" instead of local system. Not sure if that's a software issue or kace issue I wish distribution had Windows run as option.
    • Are you having trouble with any other packages? It might be a bad password saved for your local system password in Kace.
      • Second part of the script works though. code.reg executes and imports the key in to registry so I would assume the password is working. Though I have not deployed any other programs via kace in a while.
Please log in to comment
The KACE agent works as 32Bit binary using the SYSTEM service.
If you run it manually it works on the context fo the machine (32 or 64 bit) and under the user which is logged in. if the setup needs another user and especially the registry is trying to go to 64Bit or HKLM_LU or similar, this is not possible.
You can use scripting and run it under another user.
Answered 07/18/2018 by: Nico_K
Red Belt

Please log in to comment
Admin Script Editor
Admin Script Editor is an integrated scripting environment available free here at ITNinja