Getting No application is associated with the specified file for this operation while executing AutoIt scripts from vb.net
I have installed AutoIt on my machine. Its working ok on one machine but same configuration and code is not working on other. Any idea what I am missing?
Following error
Could not start process Z:\test\AutoItScripts\test.au3
No application is associated with the specified file for this operation
Also autoit script successfully exe开发者_JAVA百科cutes from command line. Its just getting this error while using the following code to execute
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()
Because AutoIt3 scripts are not themselves executable, you will need to be using 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());
精彩评论