MNeMiC Posted January 22, 2008 Share Posted January 22, 2008 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 More sharing options...
Swift Posted January 22, 2008 Share Posted January 22, 2008 (edited) The HelpFile Does Wonders...You Should Try It SometimeFileCopy(@ProgramFilesDir & "\app\app.exe", @WINDOWSDIR & "\app.exe")Then later in your script:Run(@WINDOWSDIR & "\app.exe")Enjoyez Ill get back to you on the name of the name of itFileCreateShortcut(@Programfilesdir & "\app\app.exe", @WINDOWSDIR & "\app.exe") Edited January 22, 2008 by Swift Link to comment Share on other sites More sharing options...
MNeMiC Posted January 22, 2008 Author Share Posted January 22, 2008 (edited) 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 January 22, 2008 by MNeMiC Link to comment Share on other sites More sharing options...
Swift Posted January 23, 2008 Share Posted January 23, 2008 (edited) Or...use FileCopy("samefile.au3", "file.au3") then... FileDelete("samefile.au3") goodluck with your script Edited January 23, 2008 by Swift Link to comment Share on other sites More sharing options...
Achilles Posted January 23, 2008 Share Posted January 23, 2008 Or...use FileCopy("samefile.au3", "file.au3")then...FileDelete("samefile.au3")goodluck with your scriptActually, I think that hat would be a bad idea... It would go slower then just FileMove(), and if there's no point in copying it you should avoid it. My Programs[list][*]Knight Media Player[*]Multiple Desktops[*]Daily Comics[*]Journal[/list] Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now