Error Runhidden.vbs Set-ActiveSetup

Hi!
I am trying to deploy an application with intune. The package is a PSAppDeployToolkit Package. In the package I am useing the set-activesetup function.

command line:

Set-ActiveSetup -StubExePath "$envProgramData\IntuneApps\$packageName\AdobeReaderDCUserSettings.cmd" -Description "$appVendor $appName $appVersion User Settings" -Key "$packageName" -ContinueOnError $true

When Intune installs the application (Deploy-Application.exe), an error is displayed:

Script: C:\Windows\TEMP\PSAppDeployToolkit\ExecuteAsUser\RunHidden.vbs
Line: 98
Character: 5
Error: 0x80131700
Code: 80131700
Source: (null)

When I start deploy-application.exe manually it works without an error.

I use PSAppDeployToolkit 3.10.0

Does anyone have an idea?

Thank you very much!

Best regards,
Rouven

PSADT’s Set-ActiveSetup is designed to trigger the -StubExePath if a user is logged-in at install time.

Active Setup only triggers once and Set-ActiveSetup will check if Active Setup has already been triggered or not. That’s probably why you get an error when running deploy-application.exe manually.

That said, a simple web search says you might have a corrupt windows installation or an out of date .Net Framework

The error does NOT occur when I run it manually, but when it is run via Intune.

Command line in Intune for the installation: Deploy-Application.exe

Oh boy, this is getting interesting!

PSAppDeployToolkit_v3.9.3 had no RunHidden.vbs

Only PSAppDeployToolkit_v3.9.4 (PR) and PSAppDeployToolkit_v3.10.0 have RunHidden.vbs.
It’s part of the Execute-ProcessAsUser function. (it’s used to trigger the -StubExePath if a user is logged-in at install time as that user.)

RunHidden.vbs is a new file and its line 98 (Thanks to your initial post) is:

    Set oArgumentList = CreateObject("System.Collections.ArrayList")

While doing that “simple web search” I saw mentions of ArrayList and ignored them because I thought only PowerShell and C# could use them.

According to this:
vba - automation error -2146232576 (80131700) on creating an array - Stack Overflow

The solution:

[The] solution was to install .NET 3.5 even though I had .NET 4.0 installed on my machine. You specifically need the 3.5 version to use System.Collections.ArrayList .

Do you have .net 3.5 installed?

1 Like

Hi, that was the right hint. Thank you very much! After the installation of .NET 3.5 it worked.

1 Like

Thank you for clarifying that there is a dependency on .NET 3.5 here.

Based on that hint, I was able to fix this for me in RunHidden.vbs by replacing System.Collections.ArrayList with a native VBScript array, so that there is no need to install .NET 3.5.

Dim sCmd, oWShell, iReturn, arg, bCmdDetected, oArgumentList(), i

iReturn = 0
If WScript.Arguments.Count > 0 Then
    ' Check if first argument references cmd or cmd.exe'
    bCmdDetected = IsCmdAtEnd(WScript.Arguments(0))

	ReDim oArgumentList(WScript.Arguments.Count)
    For i=0 To WScript.Arguments.Count-1
        oArgumentList(i) = ArgvQuote(WScript.Arguments(i), False, bCmdDetected)
    Next

    sCmd = Join(oArgumentList, " ")

    Set oWShell = CreateObject("WScript.Shell")
    iReturn = oWShell.Run(sCmd, 0, True)
End If

WScript.Quit iReturn
2 Likes

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.