Application path difference between "File.Run" and "FileRunAs"

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts
  • mwreyf1
    Indigo Rose Customer
    • Aug 2004
    • 417

    Application path difference between "File.Run" and "FileRunAs"

    Has anyone else experienced a problem with FileRunAs not being able to find the file pointed to in the args section of the action.

    Here is an example of my problem.

    This code works correctly running from a CD (D: drive on my test system).
    Code:
    File.Run("MsiExec.exe", "/I \"AppFolder\\My.msi\"/qn", "", SW_SHOWNORMAL, true);
    Yet, this code does NOT work. (also D: drive on my test system).
    Code:
    File.RunAs("MsiExec.exe", "/I \"AppFolder\\My.msi\"/qn", "", SW_SHOWNORMAL, true, "username", "passwd", "", LOGON_NO_OPTION, nil, nil);
    You would think there would be no difference between the way File.Run and File.RunAs would handle this same string but AMS cannot locate the MSI when using File.RunAs. It almost seems like a bug.

    If I hardcode the CD drive letter to the string such as below...It works.
    Code:
    File.RunAs("MsiExec.exe", "/I \"D:\\AppFolder\\My.msi\"/qn", "", SW_SHOWNORMAL, true, "username", "passwd", "", LOGON_NO_OPTION, nil, nil);
    Any help would be greatly appreciated.
    TIA!
  • ShadowUK
    No longer a forum member
    • Oct 2007
    • 1321

    #2
    Originally posted by mwreyf1 View Post
    Has anyone else experienced a problem with FileRunAs not being able to find the file pointed to in the args section of the action.

    Here is an example of my problem.

    This code works correctly running from a CD (D: drive on my test system).
    Code:
    File.Run("MsiExec.exe", "/I \"AppFolder\\My.msi\"/qn", "", SW_SHOWNORMAL, true);
    Yet, this code does NOT work. (also D: drive on my test system).
    Code:
    File.RunAs("MsiExec.exe", "/I \"AppFolder\\My.msi\"/qn", "", SW_SHOWNORMAL, true, "username", "passwd", "", LOGON_NO_OPTION, nil, nil);
    You would think there would be no difference between the way File.Run and File.RunAs would handle this same string but AMS cannot locate the MSI when using File.RunAs. It almost seems like a bug.

    If I hardcode the CD drive letter to the string such as below...It works.
    Code:
    File.RunAs("MsiExec.exe", "/I \"D:\\AppFolder\\My.msi\"/qn", "", SW_SHOWNORMAL, true, "username", "passwd", "", LOGON_NO_OPTION, nil, nil);
    Any help would be greatly appreciated.
    TIA!
    Code:
    File.Run("MsiExec.exe", "/I \"".._SourceDrive.."\\AppFolder\\My.msi\"/qn", "", SW_SHOWNORMAL, true);

    Comment

    • mwreyf1
      Indigo Rose Customer
      • Aug 2004
      • 417

      #3
      @ShadowUK

      Thanks!

      That worked.

      I had tried using the _SourceDrive with no success. Helps having a new set of eyes.

      Wish AMS had a MSI.RunMsiexecAs action.

      Comment

      Working...
      X