Drifter Posted August 9, 2010 Share Posted August 9, 2010 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!!! Link to comment Share on other sites More sharing options...
JFX Posted August 9, 2010 Share Posted August 9, 2010 Are the problems gone if you use ShellExecute instead of the Run command? Link to comment Share on other sites More sharing options...
Drifter Posted August 9, 2010 Author Share Posted August 9, 2010 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" 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. Link to comment Share on other sites More sharing options...
JFX Posted August 9, 2010 Share Posted August 9, 2010 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? Link to comment Share on other sites More sharing options...
Drifter Posted August 9, 2010 Author Share Posted August 9, 2010 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 Thanks. Link to comment Share on other sites More sharing options...
Ascend4nt Posted August 9, 2010 Share Posted August 9, 2010 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. My contributions: Performance Counters in Windows - Measure CPU, Disk, Network etc Performance | Network Interface Info, Statistics, and Traffic | CPU Multi-Processor Usage w/o Performance Counters | Disk and Device Read/Write Statistics | Atom Table Functions | Process, Thread, & DLL Functions UDFs | Process CPU Usage Trackers | PE File Overlay Extraction | A3X Script Extract | File + Process Imports/Exports Information | Windows Desktop Dimmer Shade | Spotlight + Focus GUI - Highlight and Dim for Eyestrain Relief | CrossHairs (FullScreen) | Rubber-Band Boxes using GUI's (_GUIBox) | GUI Fun! | IE Embedded Control Versioning (use IE9+ and HTML5 in a GUI) | Magnifier (Vista+) Functions UDF | _DLLStructDisplay (Debug!) | _EnumChildWindows (controls etc) | _FileFindEx | _ClipGetHTML | _ClipPutHTML + ClipPutHyperlink | _FileGetShortcutEx | _FilePropertiesDialog | I/O Port Functions | File(s) Drag & Drop | _RunWithReducedPrivileges | _ShellExecuteWithReducedPrivileges | _WinAPI_GetSystemInfo | dotNETGetVersions | Drive(s) Power Status | _WinGetDesktopHandle | _StringParseParameters | Screensaver, Sleep, Desktop Lock Disable | Full-Screen Crash Recovery Wrappers/Modifications of others' contributions: _DOSWildcardsToPCRegEx (original code: RobSaunder's) | WinGetAltTabWinList (original: Authenticity) UDF's added support/programming to: _ExplorerWinGetSelectedItems | MIDIEx UDF (original code: eynstyne) (All personal code/wrappers centrally located at Ascend4nt's AutoIT Code) Link to comment Share on other sites More sharing options...
Drifter Posted August 9, 2010 Author Share Posted August 9, 2010 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. Link to comment Share on other sites More sharing options...
Ascend4nt Posted August 9, 2010 Share Posted August 9, 2010 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? My contributions: Performance Counters in Windows - Measure CPU, Disk, Network etc Performance | Network Interface Info, Statistics, and Traffic | CPU Multi-Processor Usage w/o Performance Counters | Disk and Device Read/Write Statistics | Atom Table Functions | Process, Thread, & DLL Functions UDFs | Process CPU Usage Trackers | PE File Overlay Extraction | A3X Script Extract | File + Process Imports/Exports Information | Windows Desktop Dimmer Shade | Spotlight + Focus GUI - Highlight and Dim for Eyestrain Relief | CrossHairs (FullScreen) | Rubber-Band Boxes using GUI's (_GUIBox) | GUI Fun! | IE Embedded Control Versioning (use IE9+ and HTML5 in a GUI) | Magnifier (Vista+) Functions UDF | _DLLStructDisplay (Debug!) | _EnumChildWindows (controls etc) | _FileFindEx | _ClipGetHTML | _ClipPutHTML + ClipPutHyperlink | _FileGetShortcutEx | _FilePropertiesDialog | I/O Port Functions | File(s) Drag & Drop | _RunWithReducedPrivileges | _ShellExecuteWithReducedPrivileges | _WinAPI_GetSystemInfo | dotNETGetVersions | Drive(s) Power Status | _WinGetDesktopHandle | _StringParseParameters | Screensaver, Sleep, Desktop Lock Disable | Full-Screen Crash Recovery Wrappers/Modifications of others' contributions: _DOSWildcardsToPCRegEx (original code: RobSaunder's) | WinGetAltTabWinList (original: Authenticity) UDF's added support/programming to: _ExplorerWinGetSelectedItems | MIDIEx UDF (original code: eynstyne) (All personal code/wrappers centrally located at Ascend4nt's AutoIT Code) Link to comment Share on other sites More sharing options...
Richard Robertson Posted August 10, 2010 Share Posted August 10, 2010 The fatal error thing doesn't make much sense. What is the exact Run command you tried? 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