DJFuego, do you maby have an example that is not command line driven?
Printable View
DJFuego, do you maby have an example that is not command line driven?
I'll explain how to create a shortcut.
Create your On button press event
then under the object goto Misc, Create shortcut
Absolution Full Path= Appdrive$+Appdir$+Appname$+".exe"
Command Line arguments=""
Filename of the Actual shortcut="C:\Documents and Settings\Username\Start Menu\Programs\Startup\Name goes here.lnk"
Description="Name of application"
Open style=0
Working Directory=Appdrive$+Appdir$
File name of the Icon to be used=Appdrive$+Appdir$+Appname$+".exe"
Index of the Icon=0
This will create a shortcut in the startup area so your program will auto run on startup. You can substitute username for All users.
Thanks, everything works great. I have only one more question. I want the shortcut to apere on the desktop. Now I asume that diferent users will have diferent paths to their desktops, so how do I make that this shortcut will apere an every computers desktop?
Change the "Filename of the Actual Shortcut" line to the users desktop. You can use the YASO Object to retrieve the users desktop location, as it will differ on different computers.
I uploaded a very simple example to my website on letting users create their own shortcuts. Check my sig if you need it. ;)
stephen1980
:grin: Now everything works as i wanted. I have only one more question, that is rather esthetical. How come that the .lnk icon on the desktop doesen't have the image of the original .exe icon? Can that be done, so that both icons would have the same image?
Change the filename of the "Actual Icon to be Used" in the properties when you create the shortcut, to the directory of the icon/program.
stephen1980
Thanks for all the advice!
No problem. :)
stephen1980