MSFN Forum: Non Latin letters in path - MSFN Forum

Jump to content



Unattended CD/DVD Guide Homepage · MSFN Forum Rules

If you have questions about customizing Windows XP that are nLite-specific, please post them in the nLite forum, not here. If you have questions regarding the unattended installation of Windows XP, please post them in the Unattended Windows 2000/XP/2003 section.
Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic

Non Latin letters in path Or unicode support in cmd script Rate Topic: -----

#1 User is offline   K2teknik 

  • Group: Members
  • Posts: 1
  • Joined: 10-February 12
  • OS:XP Pro x86
  • Country: Country Flag

Posted 10 February 2012 - 06:09 AM

I have a strange problem, I want to start a program from a cmd file, it should be easy, but when the path contains non latin letters then things go wrong.

My program is in a folder "c:\æøå" and the program is called "start.exe"

from the command promt I can just type in "c:\æøå\start.exe" and things works ok.

But if I make a cmd file with the same line "c:\æøå\start.exe" then the line is converted when the script is executed into "c:\µ°Õ\start.exe" and that path(folder) do not exist, so no start of my program.

I had try to save my cmd file in unicode/UTF8 but that does not work at all.

What to do ?


#2 User is offline   Yzöwl 

  • Wise Owl
  • Group: Super Moderator
  • Posts: 4,195
  • Joined: 13-October 04
  • OS:Windows 7 x64

Posted 10 February 2012 - 07:04 AM

Can you start the script from the command line using your folder as a parameter?
MyBatch.cmd C:\æøå
@ECHO OFF & SETLOCAL ENABLEEXTENSIONS
FOR /F "TOKENS=*" %%# IN ("%*") DO (SET _=%%~#)
IF EXIST "%_%\START.EXE" "%_%\START.EXE"


If that is not an option, another is to use 'Terminal' font in your batch script editor.
It may look like this in another font/editor
@ECHO OFF & SETLOCAL ENABLEEXTENSIONS
IF EXIST "C:\‘›†\START.EXE" "C:\‘›†\START.EXE"
but it should be correct!

#3 User is offline   allen2 

  • Not really Newbie
  • PipPipPipPipPipPip
  • Group: Members
  • Posts: 1,439
  • Joined: 13-January 06

Posted 10 February 2012 - 08:53 AM

When i have this kind of problem with only 2 or 3 occurrences i use the good old edit from a dos prompt and type wanted text/characters.

This post has been edited by allen2: 10 February 2012 - 08:54 AM


#4 User is offline   Joseph_sw 

  • Member
  • PipPip
  • Group: Members
  • Posts: 136
  • Joined: 03-August 08
  • OS:98SE
  • Country: Country Flag

Posted 10 February 2012 - 10:37 AM

you can also use: dir /x
on parent folder to determine the actual 8.3 folder names, and use such name in your batch.

#5 User is offline   cdob 

  • Friend of MSFN
  • PipPipPipPipPip
  • Group: Members
  • Posts: 757
  • Joined: 29-September 05

Posted 12 February 2012 - 11:18 AM

View PostK2teknik, on 10 February 2012 - 06:09 AM, said:

My program is in a folder "c:\æøå" and the program is called "start.exe"

from the command promt I can just type in "c:\æøå\start.exe" and things works ok.

It's about ANSI and OEM codepages.
CMD file uses ANSI codepage and command line uses OEM codepage.
Adjust codepage.

Try a example
set CodePage=HKLM\SYSTEM\CurrentControlSet\Control\Nls\CodePage
FOR /F "tokens=1-2*" %%a IN ('%SystemRoot%\system32\reg.exe query "%CodePage%" /v "OEMCP"') DO (set OEMCP=%%c)
FOR /F "tokens=1-2*" %%a IN ('%SystemRoot%\system32\reg.exe query "%CodePage%" /v "ACP"') DO (set ACP=%%c)

echo current CodePage 
%SystemRoot%\system32\chcp.com
dir c:\æøå

echo set CodePage to %ACP%
%SystemRoot%\system32\chcp.com %ACP%
dir c:\æøå

echo set CodePage to %OEMCP%
%SystemRoot%\system32\chcp.com %OEMCP%


Share this topic:


Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic

1 User(s) are reading this topic
0 members, 1 guests, 0 anonymous users



All trademarks mentioned on this page are the property of their respective owners
Copyright © 2001 - 2011 msfn.org
Privacy Policy