none
VBS in 10v1809 uses Powershell command processor instead of CMD RRS feed

  • Question

  • I'm using a .vbs to install an .msi using msiexec in 10v1809.

    When the command is run from a CMD processor it works fine.

    When the command is run from a PowerShell command processor it fails with unable to find the specified file.

    When run from within a .vbs, it is failing just like PowerShell which tells me that Windows 10v1809 is using the PowerShell processor instead of the CMD processor.

    What I've read says to escape the " but adding a ` breaks the .vbs passing of the command.

    How can I get these .vbs commands to work?

    Call objShell.Run( """msiexec.exe /i ""D:\Acrobat DC 2019\2019\acroread.msi"" DISABLE_ARM_SERVICE_INSTALL=1 TRANSFORMS=""D:\Acrobat DC 2019\acroread.mst"" /qn" ,0 ,True )
    Call objShell.Run( """msiexec.exe /p ""D:\Acrobat DC 2019.0.10.20098\2019\AcroRdrDCUpd1901020098.msp"" REINSTALL=ALL REINSTALLMODE=omus /qn" ,0 ,True )
    
    


    Thursday, April 4, 2019 8:38 PM

Answers

  • Quoting can be tricky sometimes in Powershell ... that should work:

    msiexec.exe /i "D:\Acrobat DC 2019\2019\acroread.msi" "DISABLE_ARM_SERVICE_INSTALL=1" "TRANSFORMS=D:\Acrobat DC 2019\acroread.mst" "/qn"
    msiexec.exe /p "D:\Acrobat DC 2019.0.10.20098\2019\AcroRdrDCUpd1901020098.msp" "REINSTALL=ALL" "REINSTALLMODE=omus" "/qn"

    Some say it's more manageable or clearer this way:

    $ArgumentList = @(
        "/i",
        "D:\Acrobat DC 2019\2019\acroread.msi",
        "DISABLE_ARM_SERVICE_INSTALL=1",
        "TRANSFORMS=D:\Acrobat DC 2019\acroread.mst",
        "/qn"
    )
    Start-Process -FilePath msiexec -ArgumentList $ArgumentList
    
    $ArgumentList = @(
        "/p",
        "D:\Acrobat DC 2019.0.10.20098\2019\AcroRdrDCUpd1901020098.msp",
        "REINSTALL=ALL",
        "REINSTALLMODE=omus",
        "/qn"
    )
    Start-Process -FilePath msiexec -ArgumentList $ArgumentList


    Live long and prosper!

    (79,108,97,102|%{[char]$_})-join''

    • Edited by BOfH-666 Thursday, April 4, 2019 9:28 PM
    • Marked as answer by Ericahalfbee Friday, April 5, 2019 2:08 PM
    Thursday, April 4, 2019 9:27 PM

All replies

  • Quoting can be tricky sometimes in Powershell ... that should work:

    msiexec.exe /i "D:\Acrobat DC 2019\2019\acroread.msi" "DISABLE_ARM_SERVICE_INSTALL=1" "TRANSFORMS=D:\Acrobat DC 2019\acroread.mst" "/qn"
    msiexec.exe /p "D:\Acrobat DC 2019.0.10.20098\2019\AcroRdrDCUpd1901020098.msp" "REINSTALL=ALL" "REINSTALLMODE=omus" "/qn"

    Some say it's more manageable or clearer this way:

    $ArgumentList = @(
        "/i",
        "D:\Acrobat DC 2019\2019\acroread.msi",
        "DISABLE_ARM_SERVICE_INSTALL=1",
        "TRANSFORMS=D:\Acrobat DC 2019\acroread.mst",
        "/qn"
    )
    Start-Process -FilePath msiexec -ArgumentList $ArgumentList
    
    $ArgumentList = @(
        "/p",
        "D:\Acrobat DC 2019.0.10.20098\2019\AcroRdrDCUpd1901020098.msp",
        "REINSTALL=ALL",
        "REINSTALLMODE=omus",
        "/qn"
    )
    Start-Process -FilePath msiexec -ArgumentList $ArgumentList


    Live long and prosper!

    (79,108,97,102|%{[char]$_})-join''

    • Edited by BOfH-666 Thursday, April 4, 2019 9:28 PM
    • Marked as answer by Ericahalfbee Friday, April 5, 2019 2:08 PM
    Thursday, April 4, 2019 9:27 PM
  • VBS uses CScript to run script files.

    cscript yourfile.vbs

    Microsoft is removing VBS from the system.  It looks like VBS has not been registered as a file type.

    This has nothing to do with PowerShell.

    In new installations of W10 and later the default command processor is PowerShell.  CMD is also being removed and will not exist in future versions of Windows.

     


    \_(ツ)_/

    Thursday, April 4, 2019 9:45 PM
  • Oh boy was I caffeine deprived ... Your placing of the quotes kicked my brain back into gear.

    Call objShell.Run( "msiexec.exe /i ""D:\AAR DC\AAR DC\acroread.msi"" DISABLE_ARM_SERVICE_INSTALL=1 TRANSFORMS=""D:\AAR DC\acroread.mst"" /qn" ,0 ,True )
    Call objShell.Run( "msiexec.exe /p ""D:\AAR DC\AAR DC\AcroRdrDCUpd1901020098.msp"" REINSTALL=ALL REINSTALLMODE=omus /qn" ,0 ,True )
    ftw ... 


    Friday, April 5, 2019 2:10 PM