ATTENTION: You are viewing a page formatted for mobile devices; to view the full web page, click HERE.

Main Area and Open Discussion > General Software Discussion

Cut and paste list of files ?

<< < (3/3)

Many thanks "4wd". ;)
I have tried your script.
I added "CopyFileList.cmd" into the root of C:\prog\ (I also tried C:\)

and execute (run) : C:\prog\CopyFileList.cmd G:\transfer C:\prog\PDFTextChecker\1.txt

It copied only the first listed pdf file (with its full directory structure) and no other pdf file.

Thanks in advance ;)

Remove @echo off and run it again.

Also, you need to provide more info, eg. OS, language (I'm assuming French), etc

And an attached shortened example of the file list, so we know what encoding the file is in, containing at least one line where it fails at.

Many thanks "4wd" ;)

I  have removed "@echo off".
I have tried several things and it seems to work for simple folders and filenames. But strangely it doesn't does not work for all.

C:\prog\CopyFileList.cmd G:\transfer\ C:\1\!Not_Searchable.txt

--- End quote ---

I am adding an example that is not working for me (only one file is copied. If I have similar more paths, it copies only the first file).

I am on Win7 64 Bits. My language is french. I have removed accent from filenames.

Thanks in advance ;)

edit: file uploaded as a zip file this time

OK, the following worked here, (on Win7 x64), using the files you sent and this command, (!Not_Searchable.txt was in same directory as command):

CopyFileList.cmd R:\test\test "!Not_Searchable.txt"

!Not_Searched.txt (note the accented e)
U:\test\1_ztestpdf\1_ABCi\2003\AHYEDKI 01 2003\important\Dopmdanen 2 zuuk\old accent e a - Copie.pdf
U:\test\1_ztestpdf\1_ABCi\2003\AHYEDKI 01 2003\important\Dopmdanen 2 zuuk\old accent é a.pdf

--- End quote ---


--- Code: Text ---Rem CopyFilelist.cmd <dest path> <file list>@echo offchcp 28591setlocal EnableExtensions if exist "%~1" goto :CheckListecho Destination does not existgoto :End :CheckListif exist "%~2" goto :Copyecho No file list enteredgoto :End :Copyfor /f "tokens=* usebackq" %%I in (`type "%~2"`) do (    if not exist "%~1%%~pI" md "%~1%%~pI"    copy "%%~I" "%~1%%~pI") :End
All I've done above is change the codepage to the same as Windows normally uses, (ISO 8859-1 Latin 1; Western European (ISO)).

Also, it now checks to see if the destination directory exists before creating it.

Wow! Many thanks "4wd". ;)
I'll do more testing but this is working great so far. I even don't have to rename all my files. ;)
Thank you again. ;)
See ya


[0] Message Index

[*] Previous page

Go to full version