File.Run and Args

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts
  • WallyWonka
    Forum Member
    • Dec 2007
    • 28

    File.Run and Args

    I want create a button that will launch InstallSHIELD DeInstaller. In order to do that I need to pass a command line argument to point a DeIsL5.isu file. I tried this code and it does not work:

    RemovePath = Registry.GetValue(HKEY_LOCAL_MACHINE, "SOFTWARE\\Microsoft\\Windows\\CurrentVersion\ \App Paths\\MyApp.exe", "Path", true);
    if RemovePath ~= "" then
    result = File.Run("WIN95\\UNINST.exe", "-f"RemovePath.."\\DeIsL5.isu", "", SW_SHOWNORMAL, true);, ""), "")

    Something to do with the quotes in the Args section. But the quotes are needed to pass the command to UNINST.exe. So what am I doing wrong here? Thanks for any help on this, it is driving my bonkers.
  • Ulrich
    Indigo Rose Staff Member
    • Apr 2005
    • 5130

    #2
    Read this.

    Comment

    • WallyWonka
      Forum Member
      • Dec 2007
      • 28

      #3
      No good. That is for double quotes in a dialog text string. That doesn't work for Args. Can you post an example? I tried this:

      RemovePath = Registry.GetValue(HKEY_LOCAL_MACHINE, "SOFTWARE\\Microsoft\\Windows\\CurrentVersion\ \App Paths\\MyApp.exe", "Path", true);
      if RemovePath ~= "" then
      File.Run("WIN95\\UNINST.exe", "-f\"RemovePath.."\\DeIsL5.isu\"", "", SW_SHOWNORMAL, true);, ""), "")

      Comment

      • mwreyf1
        Indigo Rose Customer
        • Aug 2004
        • 417

        #4
        File.Run("WIN95\\UNINST.exe", "-f\ \"RemovePath..\"\\DeIsL5.isu", "", SW_SHOWNORMAL, true);

        Comment

        • WallyWonka
          Forum Member
          • Dec 2007
          • 28

          #5
          that method will work if you place an absolute path in the Args section, but for some reason the Args section doesn't pick up on the previous ResultVariable. It is reading this: "-f\ \"RemovePath..\", but stops there. It is not picking up the: DeIsL5.isu" part. I think because it is reading the quote after RemovePath..\" and thinking that it ends there. I'm not sure why this isn't working, VERY frustrating.

          Comment

          • RizlaUK
            Indigo Rose Customer
            • May 2006
            • 5552

            #6
            thats because hes closeing the string there

            try this
            Code:
            File.Run("WIN95\\UNINST.exe", "-f\ \""..RemovePath.."\\DeIsL5.isu\"", "", SW_SHOWNORMAL, true);
            Embrace change in your life, you never know, it could all work out for the best

            Comment

            • WallyWonka
              Forum Member
              • Dec 2007
              • 28

              #7
              Brilliant! That last one worked! I never thought I'd get it. Thank you! I am sure I will have more questions about other things, but thank you for helping me on this one.

              Comment

              Working...
              X