Jump to content

Creating shortcuts?


MNeMiC
 Share

Recommended Posts

So what I'd like to do is to create a shortcut to a file at a specific path (@ProgramFilesDir/AppFolder/AppName.exe), and move it to C:\Windows, in order to be able to type that shortcut's name into the RUN and then launch the program.

I need to be able to:

Create a shortcut from a file

Rename the shortcut to a custom name

Move the shortcut to the Windows directory

I'm pretty much a beginner at AutoIT, but I'm already amazed at what it can do.

I looked at some .INK shortcuts, and they are all binary, is there a way to create an ASCII shortcut, or would this have to be done with keypresses? (Like, RMB->Create Shortcut), because that probably wouldn't be too good if it's going to be executed on an international system.

Aside from actually copying the whole EXE-file, I have no idea on how to do this.

Ideas anyone?

Thanks in advance,

MNeMiC

Link to comment
Share on other sites

The HelpFile Does Wonders...You Should Try It Sometime

FileCopy(@ProgramFilesDir & "\app\app.exe", @WINDOWSDIR & "\app.exe")

Then later in your script:

Run(@WINDOWSDIR & "\app.exe")

Enjoy

ez :D

Ill get back to you on the name of the name of it

FileCreateShortcut(@Programfilesdir & "\app\app.exe", @WINDOWSDIR & "\app.exe")

Edited by Swift
Link to comment
Share on other sites

Man do I feel like a freaking retard right now. Thanks alot for the help. I did search the forums and tried looking through the function & macro lists in the online docs. Didn't figure to search for "shortcut" in the functions list though, stupid me.

Another quick question:

To rename a file, do I use the FileMove or what?

FileMove ("oldpath/oldname.oldext", "oldpath/newname.oldext")

*EDIT*

And man, do I feel like an even bigger retard now when I looked at the description, not just the syntax and it said:

"Because AutoIt lacks a "FileRename" function, use FileMove to rename a file!"

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