Fast Copy Non-Unicode Folders Problem

English support forum

Moderators: white, Hacker, petermad, Stefan2

drbeat
Junior Member
Junior Member
Posts: 57
Joined: 2017-01-01, 01:13 UTC

Fast Copy Non-Unicode Folders Problem

Post by *drbeat »

I use the button below. If a folder named as "Defian От" then Fast Copy gives error. Seems problem is related to %L command. Any solution for this?

My Button:

Code: Select all

/auto_close /balloon=FALSE /estimate /cmd=force_copy  /srcfile=%L /to="%T"
Error Message:
GetFullPathName2(The filename, directory name, or volume label syntax is incorrect.123) : f:\G geri koy\PC Games\Defian ??\
User avatar
Dalai
Power Member
Power Member
Posts: 9364
Joined: 2005-01-28, 22:17 UTC
Location: Meiningen (Südthüringen)

Post by *Dalai »

Try %WL instead of %L - provided that Fast Copy supports Unicode list files, of course.

Regards
Dalai
#101164 Personal licence
Ryzen 5 2600, 16 GiB RAM, ASUS Prime X370-A, Win7 x64

Plugins: Services2, Startups, CertificateInfo, SignatureInfo, LineBreakInfo - Download-Mirror
drbeat
Junior Member
Junior Member
Posts: 57
Joined: 2017-01-01, 01:13 UTC

Post by *drbeat »

Didn't work, source file becomes "ÿşc" only. Fast Copy supports unicode names the problem is related to TC command.
User avatar
HolgerK
Power Member
Power Member
Posts: 5406
Joined: 2006-01-26, 22:15 UTC
Location: Europe, Aachen

Post by *HolgerK »

Fast Copy supports unicode names the problem is related to TC command.
Really?
http://www.questiondriven.com/2014/04/03/fastcopy-command-line-examples/ wrote:/srcfile=”files.txt” … Specify source files by textfile. User is able to describe 1 filename per line. (Attention: If a lot of files are specified, it will take many times to display/refresh Source combobox.)

/srcfile_w=”files.txt” … same as “/srcfile=”, except describing by UNICODE.
Regards
Holger
Make our planet great again
drbeat
Junior Member
Junior Member
Posts: 57
Joined: 2017-01-01, 01:13 UTC

Post by *drbeat »

I tried this "/srcfile_w=%LW" and I get "c:\Defian От\" but before c:\ there's a square. Any solution for this?
User avatar
Horst.Epp
Power Member
Power Member
Posts: 6449
Joined: 2003-02-06, 17:36 UTC
Location: Germany

Post by *Horst.Epp »

drbeat wrote:I tried this "/srcfile_w=%LW" and I get "c:\Defian От" but before c:\ there's a square. Any solution for this?
Not %LW but %WL
%WL is Unicode 16 with BOM
%UL is Unicode 8 with BOM
I guess FastCopy doesn't like the BOM marker
Windows 11 Home x64 Version 23H2 (OS Build 22631.3374)
TC 11.03 x64 / x86
Everything 1.5.0.1371a (x64), Everything Toolbar 1.3.2, Listary Pro 6.3.0.69
QAP 11.6.3.2 x64
drbeat
Junior Member
Junior Member
Posts: 57
Joined: 2017-01-01, 01:13 UTC

Post by *drbeat »

%WL doesn't work too.
User avatar
Dalai
Power Member
Power Member
Posts: 9364
Joined: 2005-01-28, 22:17 UTC
Location: Meiningen (Südthüringen)

Post by *Dalai »

drbeat wrote:%WL doesn't work too.
"doesn't work" means what exactly?

Regards
Dalai
#101164 Personal licence
Ryzen 5 2600, 16 GiB RAM, ASUS Prime X370-A, Win7 x64

Plugins: Services2, Startups, CertificateInfo, SignatureInfo, LineBreakInfo - Download-Mirror
drbeat
Junior Member
Junior Member
Posts: 57
Joined: 2017-01-01, 01:13 UTC

Post by *drbeat »

before drive letter "c" there's a square.
with this:
/auto_close /balloon=FALSE /estimate /cmd=force_copy /srcfile_w=%WL /to="%T"
User avatar
Dalai
Power Member
Power Member
Posts: 9364
Joined: 2005-01-28, 22:17 UTC
Location: Meiningen (Südthüringen)

Post by *Dalai »

Well, I second Horst's guess that Fast Copy doesn't like the BOM (Byte Order Mark) in Unicode files. You'll have to ask their support for help about this. TC only supports list files that are either ANSI (%L) or Unicode (%WL (UTF-16), %UL (UTF-8 )) with BOM. Unicode text files without BOM are rare on Windows, although they're the vast majority on Linux.

Regards
Dalai
#101164 Personal licence
Ryzen 5 2600, 16 GiB RAM, ASUS Prime X370-A, Win7 x64

Plugins: Services2, Startups, CertificateInfo, SignatureInfo, LineBreakInfo - Download-Mirror
drbeat
Junior Member
Junior Member
Posts: 57
Joined: 2017-01-01, 01:13 UTC

Post by *drbeat »

Thank you very much for your support guys.
User avatar
Stefan2
Power Member
Power Member
Posts: 4132
Joined: 2007-09-13, 22:20 UTC
Location: Europa

PowerShell: remove BOM from TCs temp file WL

Post by *Stefan2 »

Removing the BOM

How about re-write TCs temp file to a file without BOM?

Would a UTF-8 encoding work?

Here for example a PowerShell possibility:

Code: Select all

# TC Button
# Command:   powershell -noexit -File "X:\temp\PS\RemoveBOM from TCs temp file\RemoveBOM.ps1"
# Parameter: "%WL" "%T"


$TCsTempFile = $Args[0]
$TCsTarget   = $Args[1]
#  & "notepad2.exe" $TCsTempFile 
$NewTempFile = $env:temp + "\tctempfile.txt"

# //Read and write TCs temp file, but change endcoding:
# Out-File 'Encoding' :"unknown,string,unicode,bigendianunicode,utf8,utf7,utf32,ascii,default,oem" 
Get-Content $TCsTempFile | Out-File -encoding UTF8 $NewTempFile
#  & "notepad2.exe" $NewTempFile 


# //Call here your command, now with list of files w/o BOM:
$Exe = "xxx.exe"
&$exe "/auto_close /balloon=FALSE /estimate /cmd=force_copy /srcfile_w=$NewTempFile /to=$TCsTarget"


# For the right quoting see > http://edgylogic.com/blog/powershell-and-external-commands-done-right/
#     ...how do I send parameters that contain spaces? Normally we would quote the part that has spaces, e.g.
#     &$exe -p -script="H:\backup\scripts temp\vss.cmd" E: M: P:
#     
#     But not in Powershell. That will simply confuse it. Instead, just place the entire parameter in quotes, e.g.
#     &$exe -p "-script=H:\backup\scripts temp\vss.cmd" E: M: P:
#     
#     If it is necessary for the quotes to be passed on to the external command (it very rarely is),
#     you will need to double-escape the quotes inside the string, once for PowerShell using the backtick character (`), 
#     and again for the parser using the backslash character (\). 
#     &$exe -p "-script=\`"H:\backup\scripts temp\vss.cmd\`"" E: M: P:






- - - first i wanted to try this

https://gallery.technet.microsoft.com/scriptcenter/How-to-remove-UTF8-Byte-a66fc0b2

How to remove UTF8 Byte Order Mark (BOM) from a file using PowerShell

- - - Maybe interesting too..




 
User avatar
milo1012
Power Member
Power Member
Posts: 1158
Joined: 2012-02-02, 19:23 UTC

Re: PowerShell: remove BOM from TCs temp file WL

Post by *milo1012 »

2Stefan2
I think the OT really needs UTF-16, but even there the BOM is in the way.


Anyway, I really think it's time for TC to add support for BOM-less UTF-8 list files, since a BOM produces more problems than it fixes.
I already suggested such thing 3 years ago, but no luck so far.

And BTW, in this thread you can also find a working example for how to remove the BOM in cmd shell (well, at least for calling a command for each path by yourself).
TC plugins: PCREsearch and RegXtract
drbeat
Junior Member
Junior Member
Posts: 57
Joined: 2017-01-01, 01:13 UTC

Post by *drbeat »

v3.31
Changes:
Allow BOM in the specified files by /srcfile= or /srcfile_w= options.

But same problem exists. Any suggestions?
User avatar
nsp
Power Member
Power Member
Posts: 1803
Joined: 2005-12-04, 08:39 UTC
Location: Lyon (FRANCE)
Contact:

Post by *nsp »

drbeat wrote:v3.31
Changes:
Allow BOM in the specified files by /srcfile= or /srcfile_w= options.

But same problem exists. Any suggestions?
This is a FASTCOPY BUG as srcfile and srcfile_w never worked for me even without BOM.
You should describe what you expect and which error you get using listing button or with a log file ... In fastCopy forum.
To best match your request just enclose a generated file from TC like

Code: Select all

c:\fastcopy\test-srcfile_w\01.txt
c:\fastcopy\test-srcfile_w\02.txt
c:\fastcopy\test-srcfile_w\03.txt
You can generate list with this button...

Code: Select all

TOTALCMD#BAR#DATA
cmd /c
copy %WL %T\file.txt
C:\Windows\System32\cmd.exe
FileList UTF16


-1
I personally use fastcopy with %P%S as i was never able to make it run with srcfile as first file is always skipped....
This is my button you can adapt to your needs.

Code: Select all

TOTALCMD#BAR#DATA
c:\tools\bin64\fastcopy.exe
/no_exec /cmd=force_copy  /open_window /speed=full  /to="%T"  %P%S
c:\tools\bin64\fastcopy.exe



-1
Post Reply