Sign in to follow this  
Followers 0
Eagle710

*** Updated Question regarding issue with Copying URL files- Please read

26 posts in this topic

#1 ·  Posted (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 by Eagle710

Share this post


Link to post
Share on other sites



#2 ·  Posted (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 by JohnOne

AutoIt Absolute Beginners    Require a serial    Pause Script    Video Tutorials by Morthawt   ipify 

Monkey's are, like, natures humans.

Share this post


Link to post
Share on other sites

#3 ·  Posted (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 by Varian

Share this post


Link to post
Share on other sites

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.

Share this post


Link to post
Share on other sites

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.

Share this post


Link to post
Share on other sites

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.

Share this post


Link to post
Share on other sites

#7 ·  Posted (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 by Eagle710

Share this post


Link to post
Share on other sites

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)

Share this post


Link to post
Share on other sites

The target directory does exist. I tried both those commands and it still doesnt work.

Share this post


Link to post
Share on other sites

#10 ·  Posted (edited)

Have you tried:

If FileExists("C:\users\Eagle710\desktop\TEST\TEST.url") Then

Prior to copying the file?

Edited by Country73

If you try to fail and succeed which have you done?AutoIt Forum Search

Share this post


Link to post
Share on other sites

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.

Share this post


Link to post
Share on other sites

#12 ·  Posted (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 by saywell

Share this post


Link to post
Share on other sites

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

Share this post


Link to post
Share on other sites

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]

Share this post


Link to post
Share on other sites

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?

Share this post


Link to post
Share on other sites

Could this have anything to do with Windows 7? I am running this AutoIT in windows 7.

Share this post


Link to post
Share on other sites

Nobody has any other suggestions to try. I guess maybe I will try unzipping a file.

Share this post


Link to post
Share on other sites

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\"')

Share this post


Link to post
Share on other sites

#19 ·  Posted

Did anyone ever solve this? I am experiencing the same problem.

Share this post


Link to post
Share on other sites

#20 ·  Posted

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 Gude
How 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

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