none
wshell.run to run uninstaller RRS feed

  • Question

  • This is driving me mental.... It's been a while since I have working in VB, but I thought I had the syntax down for this.

    I have a variable passed to a function.  The variable is a string path pulled from the registry.  In this case it is "c:\program files (x86)\WinRAR\Uninstall.exe"  (without the quotes).  I an trying to execute this.  As the process goes along, I log the various commands being run.

    Initially my command line was :

    wshshell.run (unInstaller& " /QN reboot=reallysuppress /S", 0, True)

    This would fail.  So I dropped the switches at the end.  Still fail.  I thought that since the path had spaces I should add in double quotes around the variable (CHAR(34)), nope.  Fail.  Various attempts:

    wshshell.run (unInstaller, 0, True)

    wshshell.run (CHR(34)&uninstaller&CHR(34), 0, True)

    wshshell.run ("c:\program files (x86)\WinRAR\Uninstall.exe", 0, True)

    They all seem to fail.  I copy the exact text in the first param of wshell.run to the log, and if I copy and paste that into Start>Run, it runs with no issues.  I can find the path, and I can find the File.

    Sorry, the fail out message is:

    The directory name is invalid

    Code: 8007010B

    I for the life of me cannot pin point the problem...

    Thursday, August 24, 2017 7:48 PM

Answers

  • command = """" & uninstaller & """ /QN reboot=reallysuppress /S"
    wshell.Run command,0,True

    \_(ツ)_/

    • Marked as answer by InLaNoche Friday, August 25, 2017 1:38 PM
    Thursday, August 24, 2017 8:57 PM

All replies

  • command = """" & uninstaller & """ /QN reboot=reallysuppress /S"
    wshell.Run command,0,True

    \_(ツ)_/

    • Marked as answer by InLaNoche Friday, August 25, 2017 1:38 PM
    Thursday, August 24, 2017 8:57 PM
  • Interesting. That worked. If I had put () around the first param, would that have worked as well? I thought that for sure the last one (just quotes around the string without switches) should have worked...

    Anyway, thanks for the answer.

    Friday, August 25, 2017 1:39 PM