Jump to content

Recommended Posts

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
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
Posted

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.

Posted

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.

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
Posted

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)
Posted

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.

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
Posted

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

Posted

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]
Posted

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?

  • 3 weeks later...
Posted

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

  • 1 year later...
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

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
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...