So, I've reviewed as much documentation as I can about InTune and NSIS and I can't seem to figure this out.

I have an NSIS silent installer that (when executed locally, even as system via psexec) runs without any issue at all but seems to do nothing when deployed with software deployment with InTune. The installer calls a batch file that runs a vbscript to enumerate all the users on a system then changes all their passwords: See below for source on all of the abovementioned.

NSIS Installer

Name "Silent"
OutFile "silent.exe"
RequestExecutionLevel admin

Function .onInit
SetSilent silent

Section ""
    File FindUsers.vbs
        File un.bat
    Exec un.bat

VBS Script

Set exclude = CreateObject("Scripting.Dictionary")
exclude.CompareMode = vbTextCompare
exclude.Add "HomeGroupUser$", True
exclude.Add "Guest", True

Set accounts = GetObject("WinNT://.")
accounts.Filter = Array("user")
For Each user In accounts
  If Not exclude.Exists(user.Name) Then WScript.Echo user.Name

And lastly the batch file:

@echo off
set newpw=Test
for /f "delims=" %%u in ('cscript //NoLogo FindUsers.vbs') do (
  echo "net user "%%u" "%newpw%""
  net user "%%u" "%newpw%"

Why wouldn't this run properly when deployed with intune but would run properly when executed as a user or as system?

2 Answers 2


should be ExecShell

ExecShell open un.bat
  • Man, if you're right I'm going to hug you. I'll try to do a deploy now.
    – A_Elric
    Jul 22, 2013 at 15:30
  • Sadly, this doesn't seem to have worked either.
    – A_Elric
    Jul 22, 2013 at 15:45

you might have to specify an output directory as well, see SetOutPath

SetOutPath $TEMP
File "un.bat" # will be extracted to $TEMP
ExecShell open "$TEMP\un.bat"

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.