Drifter Posted August 13, 2010 Share Posted August 13, 2010 Im making a program that keeps track of applications and the like, and displays them in a single interface so they are easy to find and run. My program uses ShellExecute to run the programs. It works for almost everything except two games i have: Royal Envoy and AudioSurf. In this case i tell my program to run them and nothing happens, and i get a nice folder called "CRASHDUMP" with files in there extension ".dmp". I can run the programs myself by finding them in the same path i give shellexecute and double clicking them, so why does ShellExecute fail? Is this fixable? Link to comment Share on other sites More sharing options...
jaberwacky Posted August 13, 2010 Share Posted August 13, 2010 Post your ShellExecute statement so that someone can look at it if they so desire. Helpful Posts and Websites: AutoIt3 Variables and Function Parameters MHz | AutoIt Wiki | Using the GUIToolTip UDF BrewManNH | Can't find what you're looking for on the Forum? Link to comment Share on other sites More sharing options...
Drifter Posted August 13, 2010 Author Share Posted August 13, 2010 Post your ShellExecute statement so that someone can look at it if they so desire.Not sure how that would help, its pretty literally ShellExecute($p) where $p is the path of some program depending on what the user selects... i could supply the whole prog but im not sure if that would help. Also i could upload the dump files if it might help? Link to comment Share on other sites More sharing options...
jaberwacky Posted August 13, 2010 Share Posted August 13, 2010 OK, just making sure it wasn't..., oh nevermind, I'm an idiot... Helpful Posts and Websites: AutoIt3 Variables and Function Parameters MHz | AutoIt Wiki | Using the GUIToolTip UDF BrewManNH | Can't find what you're looking for on the Forum? Link to comment Share on other sites More sharing options...
Drifter Posted August 13, 2010 Author Share Posted August 13, 2010 its all good. I'm trying to think if the issue has anything to do with what the path itself is... I'm pretty sure that's not it as anything put inside shellexecute should be treated as a literal string, and not interpreted in a goofy way... i think this involves something complex that I'm not really knowledgeable about... like how windows or the program I'm trying to execute is built? >.> But again if i can run it using normal windows stuff like shortcuts and windows explorer i cant see how autoit would botch it up..... Link to comment Share on other sites More sharing options...
omikron48 Posted August 13, 2010 Share Posted August 13, 2010 Do the file paths contain any white space in between? Have you tried using FileGetShortName then feeding the result to ShellExecute? Link to comment Share on other sites More sharing options...
AlmarM Posted August 13, 2010 Share Posted August 13, 2010 OK, just making sure it wasn't..., oh nevermind, I'm an idiot... lol. Not sure how that would help, its pretty literally ShellExecute($p) where $p is the path of some program depending on what the user selects... i could supply the whole prog but im not sure if that would help. Also i could upload the dump files if it might help?ShellExecute($p) huh? $p = @DesktopDir ShellExecute($p) What i'm trying to say is, take a look at the $p variable. Minesweeper A minesweeper game created in autoit, source available. _Mouse_UDF An UDF for registering functions to mouse events, made in pure autoit. 2D Hitbox Editor A 2D hitbox editor for quick creation of 2D sphere and rectangle hitboxes. Link to comment Share on other sites More sharing options...
Drifter Posted August 13, 2010 Author Share Posted August 13, 2010 most paths WILL contain white space as many programs used will be in either "Program Files" or "Program Files (x86)" depending on System. However, all of these work except two like i said.... really odd. Ill try short name thing though. Link to comment Share on other sites More sharing options...
Drifter Posted August 14, 2010 Author Share Posted August 14, 2010 I tried the FileGetShortName and that works for the programs that already worked. It does not work for those i was having an issue with though. Link to comment Share on other sites More sharing options...
Ascend4nt Posted August 14, 2010 Share Posted August 14, 2010 Try looking at the game shortcut to see if it sets a specific directory. Also look at the registry key 'HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\App Paths\ProgName.exe' (where ProgName.exe is your game executable), and see if the value 'Path' exists. If so, then those paths that are listed are what get added to the environment automatically before the game starts (when using ShellExecute). 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...
FlyinRiz Posted August 14, 2010 Share Posted August 14, 2010 I've have to second Ascend4nt and add that it sounds like it's a game dump file so there also might be a flag/switch also in the shortcut. -Aaron Link to comment Share on other sites More sharing options...
Drifter Posted August 17, 2010 Author Share Posted August 17, 2010 To answer Ascend4nt: BOTH the non-working games have "Start in: <exe directory here>" in properties for their link files. however, there are no registry entries whatsoever. I got to "HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\App Paths\" but then neither exe names exist as sub folders. Link to comment Share on other sites More sharing options...
Drifter Posted August 17, 2010 Author Share Posted August 17, 2010 Fixed it! I made it possible for the user to pick .lnk files as well as .exe ..... for god knows what reason sometimes the .lnk file works better. I also used _PathSplit() and placed the working directory within ShellExecute() and that seems to fix some problems as well. Thanks for the help all! 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