|
Dear community, I am willing to run an external EXE file with command arguments. The Scripting API didn't provide me with information regarding http://System.IO or running external files. The best info received was a link to MS Framework related classes, but I am actually looking for a straightforward example. I have searched UnityAnswers for some time about this, and the closest example I have found on UnityAnswers is this:
I do not use C# for my project but use Javascript instead. Process isn't recognized there. Please, can you supply me with an example of how to run an external program like "../VideoPlayer/myVideoPlayer.exe -fullscreen" for instance?
(comments are locked)
|
|
Process is in the System.Diagnostics namespace - you'll need to have import System.Diagnostics at the top of your script to be able to use it like you're doing Alternatively (though less preferable), you could use System.Diagnostics.Process instead Thanks a great lot. I feel quite ashamed by how simple my problem was ; thanks again for your help in revealing where was my mistake. Here is the full code: (At start of script) import System.Diagnostics; (where you want it to happen :) var stringPath = "../"; var myProcess = new Process(); myProcess.StartInfo.FileName = "Notepad.exe"; myProcess.StartInfo.Arguments = stringPath; myProcess.Start(); Will update if other problems are met.
May 05 '10 at 11:06 AM
Christophe F
Hi Christopher, There is nothing to be ashamed of. Rest assured that what you posted will be and has been helpful to others. I am one of those receipents.
Nov 16 '11 at 04:03 AM
ferraribeng
Would you believe it - this is still helping people. Myself included. Thanks!
Jun 28 '12 at 02:42 PM
ActionScripter
This is even helping to help, the community thank you!
Aug 05 '12 at 07:28 PM
RodrigoSeVeN
(comments are locked)
|
