Sign in to follow this  
Followers 0
Deye

file copy issue

4 posts in this topic

#1 ·  Posted (edited)

  i have a problem with a file with a special character in name
 
  for instance
 
 "C:▶ watch - YouTube.url"
  
I have a problem copying this file alone (to a new location) with filecopy or other  command copy tools 
even tried doing that with FileGetShortName
 
posted a solution for doing this in windows saying it needs  Win32::GetANSIPathName 
but i wouldn't know now how to implement this (Edit perhaps not relevant)
 
another small problem is when saving it from (lets say) array to text
it is saved as
  "C:? watch  - YouTube.url"
 
but is not much of a problem if I knew how can this file be controlled first
 
thanks for any ideas or solutions
Edited by Deye

Share this post


Link to post
Share on other sites



I'll put this on hold for now 

as when I try with a simple code it looks ok

but not with my bigger script

I need to check and see whats going on first

thanks

Share this post


Link to post
Share on other sites

if you read the file names to an array, the special character looks fine in the array.  Then if you perform filecopy commands using that character, it is once again fine.  In the test below I had 2 files in the script directory, one of them this script, the other named "▶ watch - YouTube.url", the below script absolutley made a copy and the special character was not an issue.

#include<file.au3>
#include<array.au3>


$fArray = _FileListToArray(@ScriptDir)

_ArrayDisplay($fArray)

FileCopy($fArray[2] , stringleft($fArray[2] , 1) & "_Copy_" & stringmid($fArray[2] , 2))

If you want it output to a text file, you will have to select a format that accepts that character code.


,-. .--. ________ .-. .-. ,---. ,-. .-. .-. .-.
|(| / /\ \ |\ /| |__ __||| | | || .-' | |/ / \ \_/ )/
(_) / /__\ \ |(\ / | )| | | `-' | | `-. | | / __ \ (_)
| | | __ | (_)\/ | (_) | | .-. | | .-' | | \ |__| ) (
| | | | |)| | \ / | | | | | |)| | `--. | |) \ | |
`-' |_| (_) | |\/| | `-' /( (_)/( __.' |((_)-' /(_|
'-' '-' (__) (__) (_) (__)

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