Run a program with two arguments

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts
  • searcher123
    Forum Member
    • Jun 2007
    • 59

    Run a program with two arguments

    Dear friends,
    What should I do if I want to send 2 arguments to a program in SetupFactory 7.0. For example, what is the right code for running the following script:

    regedit -s test.reg

    I try many many sample codes (e.g. File.Run("regedit.exe", "\"-s\"".." ".."\"test.reg\""), File.Run("regedit.exe", "-s test.reg", File.Run("regedit.exe -s", "test.reg"...), but no one worked.

    Thanks
    Best Regards
  • pww
    Indigo Rose Customer
    • Jun 2005
    • 470

    #2
    File.Run("regedit.exe -s test.reg");
    should work.
    Maybe the problem is regedit doesn't know where to look for test.reg, so you should pass the full path to it.
    For testing remove -s to see regedit messages.

    Comment

    • searcher123
      Forum Member
      • Jun 2007
      • 59

      #3
      Thank you very much dear PWW,:lol
      The following code worked:

      reg = "regedit.exe -s ".._TempFolder.."\\test.reg"
      result = File.Run(reg, "", "", SW_SHOWNORMAL, false);

      Best Regards

      Comment

      Working...
      X