0

我已经在我的机器上安装了 AutoIt。它在一台机器上工作正常,但相同的配置和代码在另一台机器上不起作用。知道我缺少什么吗?

跟随错误

 Could not start process Z:\test\AutoItScripts\test.au3  
 No application is associated with the specified file for this operation

autoit 脚本也可以从命令行成功执行。它只是在使用以下代码执行时出现此错误

        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()
4

2 回答 2

1

因为 AutoIt3 脚本本身不是可执行的,所以您需要使用 shellexecute。

p.UseShellExecute = true;
于 2011-07-06T15:39:27.553 回答
0
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());
于 2012-10-06T03:08:49.170 回答