将参数作为变量在运行功能中传递

问题描述 投票:0回答:1

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

; 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个回答
0
投票

Run()的第二个参数是工作目录,而不是程序的参数。您应该使用ShellExecute()还是ShellExecuteWait()代替?

© www.soinside.com 2019 - 2024. All rights reserved.