Jump to content

ShellExecute Issues....


Recommended Posts

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

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

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

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

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

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

Link to comment
Share on other sites

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

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

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