我已经在我的机器上安装了AutoIt。它在一台机器上工作正常,但相同的配置和代码在另一台机器上不起作用。你知道我错过了什么吗?
错误后 Could not start process Z:testAutoItScriptstest.au3
No application is associated with the specified file for this operation
也自动执行脚本成功地从命令行。它只是在使用以下代码执行
时得到这个错误 objProcess = New System.Diagnostics.Process()
objProcess.StartInfo.Verb = "runas"
objProcess.StartInfo.Arguments = Argument
objProcess.StartInfo.FileName = ProcessPath
objProcess.Start()
'Wait until it's finished
objProcess.WaitForExit()
'Exitcode as String
Console.WriteLine(objProcess.ExitCode.ToString())
objProcess.Close()
因为AutoIt3脚本本身不是可执行的,所以您需要使用shellexecute。
p.UseShellExecute = true;
Process compiler = new Process();
compiler.StartInfo.FileName = sExeName;
compiler.StartInfo.Arguments = sParameters;
compiler.StartInfo.UseShellExecute = false;
compiler.StartInfo.RedirectStandardOutput = true;
compiler.Start();
Console.WriteLine(compiler.StandardOutput.ReadToEnd());