Ward Gerlach Posted September 21, 2007 Share Posted September 21, 2007 When using FileCopy, I've noticed that shorcuts (*.LNK) files don't copy. I'm trying to copy shortcuts from C:\SOME_DIR to C:\Documents and Settings\All Users\Desktop\ Here's a code snippet: CODEFileCopy ("C:\Scripts\WordEULA.lnk", "C:\Documents and Settings\All Users\Desktop\", 9) The question is: Are shortcut files (*.LNK) so odd that FileCopy () can't handle them? Link to comment Share on other sites More sharing options...
Tiger Posted September 21, 2007 Share Posted September 21, 2007 Use the type txt to copy My UDFs:- _RegEnumKey Link to comment Share on other sites More sharing options...
Ward Gerlach Posted September 21, 2007 Author Share Posted September 21, 2007 In a CMD window, a DIR shows a shortcut has the extension LNK - so the extension TXT won't work. Link to comment Share on other sites More sharing options...
The Kandie Man Posted September 21, 2007 Share Posted September 21, 2007 (edited) Are you sure WordEULA.lnk is a shortcut? FileCopy copies shortcut files fine for me. If you can see the .lnk file extension, something is wrong because even with my settings(the OS shows all filetypes, hidden files, and system files), I can't see the .lnk extension. If you can see the .lnk extension and your file is actually a shortcut, this leads me to believe that your file is actually named "WordEULA.lnk.lnk". Try this to see if it works if that is the case:FileCopy ("C:\Scripts\WordEULA.lnk.lnk", "C:\Documents and Settings\All Users\Desktop\", 9) EDIT: Didn't see your post explaining that you used dir to get the file listings in the directory. Dir does show the correct extension, making the above mistake less likely. - The Kandie Man ;-) Edited September 21, 2007 by The Kandie Man "So man has sown the wind and reaped the world. Perhaps in the next few hours there will no remembrance of the past and no hope for the future that might have been." & _"All the works of man will be consumed in the great fire after which he was created." & _"And if there is a future for man, insensitive as he is, proud and defiant in his pursuit of power, let him resolve to live it lovingly, for he knows well how to do so." & _"Then he may say once more, 'Truly the light is sweet, and what a pleasant thing it is for the eyes to see the sun.'" - The Day the Earth Caught Fire Link to comment Share on other sites More sharing options...
Ward Gerlach Posted September 21, 2007 Author Share Posted September 21, 2007 (edited) Which is why I looked at the file in a command window (Start/Run/CMD) EDIT - I didn't read far enough down - sorry! Edited September 21, 2007 by Ward Gerlach Link to comment Share on other sites More sharing options...
The Kandie Man Posted September 21, 2007 Share Posted September 21, 2007 See if this works, just for kicks:FileCopy ("C:\Scripts\WordEULA.lnk", "C:\Documents and Settings\All Users\Desktop\WordEULA.lnk", 9) Also, what version of windows are you using? - The Kandie Man ;-) "So man has sown the wind and reaped the world. Perhaps in the next few hours there will no remembrance of the past and no hope for the future that might have been." & _"All the works of man will be consumed in the great fire after which he was created." & _"And if there is a future for man, insensitive as he is, proud and defiant in his pursuit of power, let him resolve to live it lovingly, for he knows well how to do so." & _"Then he may say once more, 'Truly the light is sweet, and what a pleasant thing it is for the eyes to see the sun.'" - The Day the Earth Caught Fire Link to comment Share on other sites More sharing options...
Ward Gerlach Posted September 21, 2007 Author Share Posted September 21, 2007 What I really hate is typos. Instead of "C:\Scripts\etc" the code should read "C:\Script\etc". (Banging head on desk, using NSFW language under breath, etc) Thanks for your patience..... Ò¿Ö Link to comment Share on other sites More sharing options...
The Kandie Man Posted September 21, 2007 Share Posted September 21, 2007 What I really hate is typos. Instead of "C:\Scripts\etc" the code should read "C:\Script\etc".(Banging head on desk, using NSFW language under breath, etc)Thanks for your patience..... Ò¿ÖIt happens to the best of us. Glad you got the problem resolved.- The Kandie Man ;-) "So man has sown the wind and reaped the world. Perhaps in the next few hours there will no remembrance of the past and no hope for the future that might have been." & _"All the works of man will be consumed in the great fire after which he was created." & _"And if there is a future for man, insensitive as he is, proud and defiant in his pursuit of power, let him resolve to live it lovingly, for he knows well how to do so." & _"Then he may say once more, 'Truly the light is sweet, and what a pleasant thing it is for the eyes to see the sun.'" - The Day the Earth Caught Fire Link to comment Share on other sites More sharing options...
aslani Posted September 21, 2007 Share Posted September 21, 2007 I just did this; FileCopy("C:\Documents and Settings\some_user\Desktop\Paint.lnk", "C:\Documents and Settings\some_user\Desktop\Temp\", 9) And it works. Just to show you that FileCopy() can handle *.lnk files. What I'm thinking is that, either your source doesn't exist or your destination. [font="Georgia"]Chances are, I'm wrong.[/font]HotKey trouble?Stringregexp GuideAutoIT Current Version Link to comment Share on other sites More sharing options...
atadams77 Posted April 2, 2012 Share Posted April 2, 2012 what if your destination is a hidden folder? Link to comment Share on other sites More sharing options...
Moderators Melba23 Posted April 2, 2012 Moderators Share Posted April 2, 2012 atadams77, This thread is over 4 years old - please do not necro-post again. We do not encourage it because AutoIt has changed enormously since then and it is very unlikely the problem and/or code are still relevant today. M23 Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind Open spoiler to see my UDFs: Spoiler ArrayMultiColSort ---- Sort arrays on multiple columnsChooseFileFolder ---- Single and multiple selections from specified path treeview listingDate_Time_Convert -- Easily convert date/time formats, including the language usedExtMsgBox --------- A highly customisable replacement for MsgBoxGUIExtender -------- Extend and retract multiple sections within a GUIGUIFrame ---------- Subdivide GUIs into many adjustable framesGUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView itemsGUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeViewMarquee ----------- Scrolling tickertape GUIsNoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxesNotify ------------- Small notifications on the edge of the displayScrollbars ----------Automatically sized scrollbars with a single commandStringSize ---------- Automatically size controls to fit textToast -------------- Small GUIs which pop out of the notification area 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