Jump to content

FileCreateShortcut - shortcut crashes application


Recommended Posts

I can't seem to make a shortcut to save my life. After the script runs the shortcut is on the desktop, it has the RISK II icon, and when I click it the game starts and then crashes.

FileCreateShortcut(@ProgramFilesDir & "\RISK2\RISKII.EXE", @DesktopDir & "\RISKII.lnk")

Error:

Risk II has encountered a problem and needs to close. We are sorry for the inconvenience.

I can go to the game and click on the RISKII.EXE and the game runs fine. I can right click it and "Send To -> Desktop (create shortcut)" and that shortcut works with no problems. Am I doing something wrong with the FileCreateShortcut syntax?

Thanks,

ss3

Link to comment
Share on other sites

  • Developers

Did you compare the information in the shortcuts?

Probably you need to add the WorkingDir parameter.

Jos

SciTE4AutoIt3 Full installer Download page   - Beta files       Read before posting     How to post scriptsource   Forum etiquette  Forum Rules 
 
Live for the present,
Dream of the future,
Learn from the past.
  :)

Link to comment
Share on other sites

You were absolutely correct. I just assumed since it wasn't required parameter that I didn't need it.

FileCreateShortcut(@ProgramFilesDir & "\RISK2\RISKII.EXE", @DesktopDir & "\RISK II.lnk", @ProgramFilesDir & "\RISK2")

I can't believe that I didn't even think of comparing the two shortcuts, if I had I would have seen this right away. I must be tired or something.

Thank you for throwing the cold water on me and waking me up. :)

ss3

Edited by ss3vegeta
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...