angelo88 Posted May 5, 2010 Share Posted May 5, 2010 Good day to you all. I am Angelo, new, and greet you all. This is my second attempt to autoIT, and I have stumbled upon a common problem that I solved before, and got stuck again. All i want to do is run a commandline having a single space: this one works perfectly in the "run" commandline of windows. C:\angelo\emu\NES\FCEU\fceux.exe PINBALL.nes I have googled and came across solutions for multiple spaces in filenames, and have experimented, but I have failed. even with different kind of " and ' combinations. My last try was: Run("C:\angelo\emu\NES\FCEU\fceux.exe " & "PINBALL.nes") Which only loads the "fceux.exe" part :| Any quick hint ? Link to comment Share on other sites More sharing options...
Developers Jos Posted May 5, 2010 Developers Share Posted May 5, 2010 Where is pinball.nes located? Try setting that directory as workingdir in your run() statement. SciTE4AutoIt3 Full installer Download page - Beta files Read before posting How to post scriptsource Forum etiquette Forum Rules Live for the present, Dream of the future, Learn from the past. Link to comment Share on other sites More sharing options...
angelo88 Posted May 5, 2010 Author Share Posted May 5, 2010 Where is pinball.nes located?Try setting that directory as workingdir in your run() statement.Thank you for a fast reply and hint.I will read the documentation for workingdir.Tho,fceux and pinball.nes are in the same directory. I have difficulties graspingwhy a working dir is needed, the main command (fceux) has a full path given, and defaultlylooks in its working directory for "pinball.nes". All it has to do is having theOS parse "C:\angelo\emu\NES\FCEU\fceux.exe PINBALL.nes". Intriguing, thanks again. Link to comment Share on other sites More sharing options...
Neno Posted May 5, 2010 Share Posted May 5, 2010 (edited) I would first try using a variable $var = "C:\angelo\emu\NES\FCEU\fceux.exe PINBALL.nes" Run($var) Sounds wierd but sometimes that does the trick. Failing that, I would do this: Run("cmd.exe") sleep(20) Send("C:\angelo\emu\NES\FCEU\fceux.exe PINBALL.nes", 1) Sleep(10) ProcessClose("cmd.exe") That's the poormans' way of doing it lol. Edit:: There's probably a shell execute way of doing things that are more reliable. Edited May 5, 2010 by Neno Link to comment Share on other sites More sharing options...
angelo88 Posted May 5, 2010 Author Share Posted May 5, 2010 Thank you Neno. Here is the fun part: When i run C:\angelo\emu\NES\FCEU\fceux.exe PINBALL.nes in windows vista's "quick command" startmenu option it runs the executable and loads pinball.nes When done in a commandline window, it doesnt, only the fceux process starts. I am not smart enough for all this i'll figure it out tho ! Link to comment Share on other sites More sharing options...
AdmiralAlkex Posted May 5, 2010 Share Posted May 5, 2010 (edited) I believe Run() by default sets the working directory to the scripts dir, so that could be why it fails. Please try and set the working dir as Jos suggested. Edited May 5, 2010 by AdmiralAlkex .Some of my scripts: ShiftER, Codec-Control, Resolution switcher for HTC ShiftSome of my UDFs: SDL UDF, SetDefaultDllDirectories, Converting GDI+ Bitmap/Image to SDL Surface Link to comment Share on other sites More sharing options...
Neno Posted May 5, 2010 Share Posted May 5, 2010 Thank you Neno. Here is the fun part: When i run C:\angelo\emu\NES\FCEU\fceux.exe PINBALL.nes in windows vista's "quick command" startmenu option it runs the executable and loads pinball.nes When done in a commandline window, it doesnt, only the fceux process starts. I am not smart enough for all this i'll figure it out tho ! Here you go, sorry: ShellExecute("C:\angelo\emu\NES\FCEU\fceux.exe","PINBALL.nes") Link to comment Share on other sites More sharing options...
Developers Jos Posted May 5, 2010 Developers Share Posted May 5, 2010 (edited) Thank you for a fast reply and hint. I will read the documentation for workingdir. Tho, fceux and pinball.nes are in the same directory. I have difficulties grasping why a working dir is needed, the main command (fceux) has a full path given, and defaultly looks in its working directory for "pinball.nes". All it has to do is having the OS parse "C:\angelo\emu\NES\FCEU\fceux.exe PINBALL.nes". Intriguing, thanks again. So did you try?: Run("C:\angelo\emu\NES\FCEU\fceux.exe PINBALL.nes","C:\angelo\emu\NES\FCEU") Jos Edited May 5, 2010 by Jos SciTE4AutoIt3 Full installer Download page - Beta files Read before posting How to post scriptsource Forum etiquette Forum Rules Live for the present, Dream of the future, Learn from the past. Link to comment Share on other sites More sharing options...
AdmiralAlkex Posted May 5, 2010 Share Posted May 5, 2010 (edited) @Joscan you really set an exe as working dir? Edit: That was fast Edited May 5, 2010 by AdmiralAlkex .Some of my scripts: ShiftER, Codec-Control, Resolution switcher for HTC ShiftSome of my UDFs: SDL UDF, SetDefaultDllDirectories, Converting GDI+ Bitmap/Image to SDL Surface Link to comment Share on other sites More sharing options...
Developers Jos Posted May 5, 2010 Developers Share Posted May 5, 2010 @Joscan you really set an exe as working dir? Was already fixed SciTE4AutoIt3 Full installer Download page - Beta files Read before posting How to post scriptsource Forum etiquette Forum Rules Live for the present, Dream of the future, Learn from the past. Link to comment Share on other sites More sharing options...
angelo88 Posted May 5, 2010 Author Share Posted May 5, 2010 So did you try?: Run("C:\angelo\emu\NES\FCEU\fceux.exe PINBALL.nes","C:\angelo\emu\NES\FCEU") Jos That works perfectly, I see what you did there. Thank you. The path makes sense. I will read more about it. Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now