Eagle710 Posted February 7, 2011 Share Posted February 7, 2011 (edited) When I try and use the DirCopy to copy an entire structure including all the files(URL shortcuts) or the FileCopy to copy a specific URL shortcut it doesnt work. Any ideas why? Edited March 4, 2011 by Eagle710 Link to comment Share on other sites More sharing options...
JohnOne Posted February 7, 2011 Share Posted February 7, 2011 (edited) Shall we just cast some voodoo spell, or are you going to show us your faulty code ?EDIT:Paste your code between two tags like this[autoit]Past your code here[/autoit] Edited February 7, 2011 by JohnOne AutoIt Absolute Beginners Require a serial Pause Script Video Tutorials by Morthawt ipify Monkey's are, like, natures humans. Link to comment Share on other sites More sharing options...
Varian Posted February 7, 2011 Share Posted February 7, 2011 (edited) This may not be your issue, but if the path of the file to be copied is greater than 255 characters then Windows will fail to copy. The path includes the drive, the folder(s), and the file name.EDIT: You may also have an issue with certain characters in the file name. Not that the file cannot be copied, but with your syntax, your script may error out. If you need more assistance post your relevant code, the error that you receive, and names of the files/directories that you are copying (if applicable). Edited February 7, 2011 by Varian Link to comment Share on other sites More sharing options...
Eagle710 Posted February 8, 2011 Author Share Posted February 8, 2011 No error messages appear. I will check the length of the source directory as it may be that long but I highly doubt it. Even when I try from a simple C:\Test\Test.url to C:\Users\Eagle710\Favorites\Links it doesn't work. Link to comment Share on other sites More sharing options...
Eagle710 Posted February 8, 2011 Author Share Posted February 8, 2011 No single file is more than 255 ..only about 80 chars. The line I am using is FileCopy("C:\users\Eagle710\desktop\TEST\TEST.url", "C:\Favorites\Links\", 1) DirCopy("E:\TEST\Favorites\", "C:\users\Eagle710\Favorites\") E is my USB drive. Link to comment Share on other sites More sharing options...
somdcomputerguy Posted February 8, 2011 Share Posted February 8, 2011 Try #RequireAdmin. (Add that to the top of the script) - Bruce /*somdcomputerguy */ If you change the way you look at things, the things you look at change. Link to comment Share on other sites More sharing options...
Eagle710 Posted February 14, 2011 Author Share Posted February 14, 2011 (edited) Tried with the RequireAdmin and it still doesn't work. Any other suggestions? Am I the only one who is having an issue with this? Edited February 14, 2011 by Eagle710 Link to comment Share on other sites More sharing options...
Varian Posted February 15, 2011 Share Posted February 15, 2011 Do the target directories exist already? Try FileCopy("C:\users\Eagle710\desktop\TEST\TEST.url", "C:\Favorites\Links\", 1 + 8) DirCopy("E:\TEST\Favorites\", "C:\users\Eagle710\Favorites\", 1) Link to comment Share on other sites More sharing options...
Eagle710 Posted February 15, 2011 Author Share Posted February 15, 2011 The target directory does exist. I tried both those commands and it still doesnt work. Link to comment Share on other sites More sharing options...
Country73 Posted February 15, 2011 Share Posted February 15, 2011 (edited) Have you tried: If FileExists("C:\users\Eagle710\desktop\TEST\TEST.url") Then Prior to copying the file? Edited February 15, 2011 by Country73 If you try to fail and succeed which have you done?AutoIt Forum Search Link to comment Share on other sites More sharing options...
Eagle710 Posted February 15, 2011 Author Share Posted February 15, 2011 I tried that but it still doesnt matter. Its very strange that it wont copy only url files. It will copy anything else between those two paths but not url extension files. Link to comment Share on other sites More sharing options...
saywell Posted February 15, 2011 Share Posted February 15, 2011 (edited) Do the URLs actually have .url extensions? Windows seems to do funny things with links and urls! Like not showing the final extension even with explorer settings to show it! I dragged some firefox links into a folder, along with one from IE and looked at them with this: $file = FileOpenDialog ("Choose", "O:\Useful links etc", "All files (*.*)") $a = FileGetLongName($file) msgbox(0,"long file name", $a) The firefox ones don't have .url at the end. The IE one does, but I get an error to say it's invalid! As I do if I copy one from my FF bookmarks folder. William PS might be worth trying file list to array or find file first/next and using those to copy them one at a time. Edited February 15, 2011 by saywell Link to comment Share on other sites More sharing options...
Country73 Posted February 15, 2011 Share Posted February 15, 2011 Just tested this out on my system, different path for my desktop, and it worked without a problem. Just ran this inside of SciTE Local $Target = "C:\users\Eagle710\desktop\TEST\TEST.url" If FileExists($Target) Then FileCopy($Target, "C:\users\Eagle710\Favorites\",9) Else ConsoleWrite("Unable to locate: " & $Target & @CRLF) EndIf If you try to fail and succeed which have you done?AutoIt Forum Search Link to comment Share on other sites More sharing options...
hannes08 Posted February 15, 2011 Share Posted February 15, 2011 Hi Eagle710, what happens when you try copying it over the command prompt? Regards, Hannes Regards,Hannes[spoiler]If you can't convince them, confuse them![/spoiler] Link to comment Share on other sites More sharing options...
Eagle710 Posted February 15, 2011 Author Share Posted February 15, 2011 When I look at the file through Command prompt the extension is .url. Copying via the command line works fine. Should I just run a batch file to copy these files? call it from the AutoIT? Link to comment Share on other sites More sharing options...
Eagle710 Posted February 15, 2011 Author Share Posted February 15, 2011 Could this have anything to do with Windows 7? I am running this AutoIT in windows 7. Link to comment Share on other sites More sharing options...
Eagle710 Posted February 17, 2011 Author Share Posted February 17, 2011 Nobody has any other suggestions to try. I guess maybe I will try unzipping a file. Link to comment Share on other sites More sharing options...
Eagle710 Posted March 4, 2011 Author Share Posted March 4, 2011 How could I use Xcopy to copy the urls over given the fact that a variable will be used in the destination folder name. Is the syntax for this code correct? eg: Run('xcopy /eq "c:\Temp\IE Favorites\All My Links\*" "C:\users\' &@username& 'Favorites\"') Link to comment Share on other sites More sharing options...
tnek Posted May 2, 2012 Share Posted May 2, 2012 Did anyone ever solve this? I am experiencing the same problem. Link to comment Share on other sites More sharing options...
BrewManNH Posted May 2, 2012 Share Posted May 2, 2012 What have you tried? If I posted any code, assume that code was written using the latest release version unless stated otherwise. Also, if it doesn't work on XP I can't help with that because I don't have access to XP, and I'm not going to.Give a programmer the correct code and he can do his work for a day. Teach a programmer to debug and he can do his work for a lifetime - by Chirag GudeHow to ask questions the smart way! I hereby grant any person the right to use any code I post, that I am the original author of, on the autoitscript.com forums, unless I've specifically stated otherwise in the code or the thread post. If you do use my code all I ask, as a courtesy, is to make note of where you got it from. Back up and restore Windows user files _Array.au3 - Modified array functions that include support for 2D arrays. - ColorChooser - An add-on for SciTE that pops up a color dialog so you can select and paste a color code into a script. - Customizable Splashscreen GUI w/Progress Bar - Create a custom "splash screen" GUI with a progress bar and custom label. - _FileGetProperty - Retrieve the properties of a file - SciTE Toolbar - A toolbar demo for use with the SciTE editor - GUIRegisterMsg demo - Demo script to show how to use the Windows messages to interact with controls and your GUI. - Latin Square password generator 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