Computing.Net > Forums > Programming > Special characters in batch

Computer Problems? Computing.Net has over 1,000,000 posts about all things technology related! Over 90% answered within 24 hours! Click here to start participating now! Also, be sure to check out the New User Guide.

Special characters in batch

Reply to Message Icon

Name: sLysdal
Date: June 30, 2009 at 18:30:51 Pacific
OS: Windows Vista
Subcategory: Batch
Comment:

Hey i have this problem, i use this script to update my iTunes music catalogue ...

"%PROGRAMFILES%\iTunes Library Updater\ITLUconsole.exe" /a /l /r "K:\Media\Søren\Musik"

but when i run it is cant read the "ø" so it says invalid location...

and i cant move the folder, because i got to many files and too many programs depending on it...



Sponsored Link
Ads by Google

Response Number 1
Name: Judago
Date: July 1, 2009 at 02:09:41 Pacific
Reply:

Extended characters are a bit of a problem in batch.

There are two main ways to achieve what you want to do, either
change the code page or find the character that is used for
your characters alias.

Changing the code page is probably the easiest, here is something
that may work:

for /f "tokens=2 delims=:" %%a in ('2^>nul chcp') do set cp=%%a
>nul 2>&1 chcp 1252
"%PROGRAMFILES%\iTunes Library Updater\ITLUconsole.exe" /a /l /r "K:\Media\Søren\Musik"
>nul 2>&1 chcp%cp%

It first sets the current code page number to %cp% changes
to codepage 1252, which can handle the character then executes
you command then restores the original code page to avoid other
problems.


The other way would be to use a "alias" character specific to
your code page.

copy the character in question.
Start>run>cmd
type in "echo "
right click>paste
now type in ">filename.txt" and hit enter (it should now
look like "echo ø>filename.txt")
type in "start notepad filename.txt"
copy the character from notepad and use it in place of
the character in question within the script.

Either method should have levels of success.


0
Reply to Message Icon

Related Posts

See More







Post Locked

This post is quite old and has been locked from receiving new replies. Please create a new posting instead.


Go to Programming Forum Home


Sponsored links

Ads by Google


Results for: Special characters in batch

Using the arrow character in batch. www.computing.net/answers/programming/using-the-arrow-character-in-batch/18976.html

Removing special Characters in File names www.computing.net/answers/programming/removing-special-characters-in-file-names/19885.html

recognizing special characters for C www.computing.net/answers/programming/recognizing-special-characters-for-c/1011.html