Jump to content
Sign in to follow this  
Drifter

Problem with "Run" command

Recommended Posts

Drifter

Is it just me or is there a really large issue with the "Run" command. Most any time i use it to, say run one of my games, i get "FATAL ERROR, Invalid command line parameter: -changedir"

I am running on WinVista Premium, x64.... the run command WILL work when i test silly obvious things like "notepad" but when i supply some sort of full path... oh no it doesnt like it! ;)

Is there something im doing wrong? do i need to have a working directory? Is there an issue with spaces in the path? Is it my architecture/OS? Is there a bug in the command?

Any information would be extremely helpful. Right now im using WinKey + R to run all my stuff, it seems REALLY silly for such a nice programming language like this not to be able to run programs properly!!! :blink:

Share this post


Link to post
Share on other sites
JFX

Are the problems gone if you use ShellExecute instead of the Run command?

Share this post


Link to post
Share on other sites
Drifter

Are the problems gone if you use ShellExecute instead of the Run command?

Yes.... yes they are! or at least with what ive tried so far that doesnt work with "Run" :blink:

Why doesnt run work and ShellExecute does? from what im seeing in the help file they do basically the same thing but using a different route. I don't understand.

Share this post


Link to post
Share on other sites
JFX

Why doesnt run work and ShellExecute does? from what im seeing in the help file they do basically the same thing but using a different route. I don't understand.

Shellexecute would trigger UAC, Run command would not.

Don't know if this is the reason for your problem, do have something to reproduce?

Share this post


Link to post
Share on other sites
Drifter

So are you saying that since Run would not go through UAC its seen as dangerous or something and therefore blocked? I would have thought that it would be the other way around, if Run went through UAC and since it doesnt actually come up, the response is a deny. Not that i really know a dang thing about all of this.

....if youre asking if i have code that replicates this issue, not really. This is only because the error is so easy to replicate in my case. Just try running any program with a filepath >.>

Most of what i used was games, so it was in the path:

"C:\Program Files (x86)\"

Regardless of why this happens, i know now to use ShellExecute, but id still like to understand better why Run doesnt work, if anyone has more info :blink: Thanks.

Share this post


Link to post
Share on other sites
Ascend4nt

Check this branch of the registry (where GameExecutable.exe is the name of the game you are running):

HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\App Paths\GameExecutable.Exe

Look for a value called 'Path' and if it exists, that's probably the reason the program won't run correctly. ShellExecute automatically sets those paths. You can do the same yourself though, by adding those paths to the PATH environment variable.

If the above doesn't apply, then I'm curious too why it wouldn't work.

Share this post


Link to post
Share on other sites
Drifter

yeah,went to the path you specified with regedit, none of the programs had a "Path" set there. Perplexing! oh well, i guess in the larger picture what matters is to use shellexecute. :blink:

Share this post


Link to post
Share on other sites
Ascend4nt

Hmm, I could take a guess that if you are running your script in 32-bit mode, then the file redirection in an x64 O/S might not recognize the ' (x86)' part of your path (which would just be the same as @ProgramFilesDir), but if ShellExecute works.. that's a bit perplexing.

Do you have a Run() example that fails for you?

Share this post


Link to post
Share on other sites
Richard Robertson

The fatal error thing doesn't make much sense. What is the exact Run command you tried?

Share this post


Link to post
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
Sign in to follow this  

×

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.