Jump to content

space/quotes in run


Recommended Posts

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

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 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.

Link to comment
Share on other sites

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 by Neno
Link to comment
Share on other sites

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 :idea:

i'll figure it out tho !

Link to comment
Share on other sites

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 by AdmiralAlkex
Link to comment
Share on other sites

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 :idea:

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

  • Developers

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 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

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

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...