Deye Posted February 16, 2015 Posted February 16, 2015 (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 someone here http://stackoverflow.com/questions/3762249/how-can-i-copy-files-with-special-characters-in-their-names-with-perls-fileco 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 February 16, 2015 by Deye
JohnOne Posted February 16, 2015 Posted February 16, 2015 Show Code. AutoIt Absolute Beginners Require a serial Pause Script Video Tutorials by Morthawt ipify Monkey's are, like, natures humans.
Deye Posted February 16, 2015 Author Posted February 16, 2015 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
iamtheky Posted February 18, 2015 Posted February 18, 2015 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. ,-. .--. ________ .-. .-. ,---. ,-. .-. .-. .-. |(| / /\ \ |\ /| |__ __||| | | || .-' | |/ / \ \_/ )/ (_) / /__\ \ |(\ / | )| | | `-' | | `-. | | / __ \ (_) | | | __ | (_)\/ | (_) | | .-. | | .-' | | \ |__| ) ( | | | | |)| | \ / | | | | | |)| | `--. | |) \ | | `-' |_| (_) | |\/| | `-' /( (_)/( __.' |((_)-' /(_| '-' '-' (__) (__) (_) (__)
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now