Jump to content
Sign in to follow this  
Drifter

ShellExecute Issues....

Recommended Posts

Drifter

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?

Share this post


Link to post
Share on other sites
Drifter

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?

Share this post


Link to post
Share on other sites
Drifter

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

Share this post


Link to post
Share on other sites
omikron48

Do the file paths contain any white space in between? Have you tried using FileGetShortName then feeding the result to ShellExecute?

Share this post


Link to post
Share on other sites
AlmarM

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.

Share this post


Link to post
Share on other sites
Drifter

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.

Share this post


Link to post
Share on other sites
Drifter

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.

Share this post


Link to post
Share on other sites
Ascend4nt

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

Share this post


Link to post
Share on other sites
FlyinRiz

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

Share this post


Link to post
Share on other sites
Drifter

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.

Share this post


Link to post
Share on other sites
Drifter

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!

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  

×