Jump to content

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


 Share

Recommended Posts

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.

Link to comment
Share on other sites

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
Link to comment
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.

Link to comment
Share on other sites

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
Link to comment
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

Link to comment
Share on other sites

  • 3 weeks later...

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

  • 1 year later...

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

Link to comment
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
 Share

  • Recently Browsing   0 members

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