【问题标题】:Passing parameter as variable in Run function在运行函数中将参数作为变量传递
【发布时间】:2019-10-22 06:26:27
【问题描述】:

正如标题所说,这是我的代码,但它不起作用

; Get the parameter from open file dialog
GUICtrlSetData($locationtxt, FileOpenDialog("Select the program", '', "Supported files (*.exe;*.msi;*.reg;*.inf)|Executable Files (*.exe)|Microsoft Installer files (*.msi)|Registry files (*.reg)|Inf files (*.inf)", 3))

; store the value in a variable 
 $abc = GUICtrlRead($locationtxt)
 ; Run the program and pass the parameter value
            Run("ussf.exe "  & $abc  )

  ; If i do it this way, its working but i want the parameter value from the open dialog not fixed
  Run("ussf.exe C:\Users\project\ccsetup563.exe")

【问题讨论】:

    标签: autoit


    【解决方案1】:

    Run() 的第二个参数是工作目录,而不是程序的参数。我认为您应该改用 ShellExecute() 或 ShellExecuteWait()。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2011-06-12
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多