Sign in to follow this  
Followers 0
cypher175

Copy Files That Shortcut links Point To..?

2 posts in this topic

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



$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  
Followers 0