Jump to content
Sign in to follow this  
cypher175

Copy Files That Shortcut links Point To..?

Recommended Posts

cypher175

Is there any way for AutoIt to read a shortcut.lnk file and then copy the file its pointing to, into another directory..??

say like DOC123.lnk exists in folder "C:\Documents and Settings\%username%\Recent\" and it points to "C:\Documents and Settings\%username%\Desktop\DOC123.RTF"

is there anyway to read that shortcut.lnk file then copy the file it points to, into another directory, then delete that shortcut.lnk file..??

Share this post


Link to post
Share on other sites
oMBRa

$ShortcutPath = 'Path of your shortcut'
$PathTo = FileGetShortcut($ShortcutPath)
$Destination = @DesktopDir; replace this with your destination

If Not @error = 1 Then
    FileCopy($PathTo[0], $Destination)
    FileDelete($ShortcutPath)
Else
    MsgBox(0, '', 'invalid shortcut')
EndIf

Share this post


Link to post
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
Sign in to follow this  

×

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.