batch but not the accent

April 28, 2010 at 00:59:08
Specs: Windows XP, 2 gb
this very simple command (an example):
xcopy D:\gantt G:\Qualità\UIA\gantt\
does not work properly because of the presence of a "special charachter" like "à" (an "a" with the accent) in the path name.
I hate that special characters and normally I'm not using them but unfortunately in this case I can not rename the destination folder
is there a way to workaround this problem in a batch script?
thanks

See More: batch but not the accent

Report •

#1
April 28, 2010 at 09:58:47
Try to replace G:\Qualità with G:\Qualit~1

Special characters can be a pain, I would do ANYTHING to get rid of them.


Report •

#2
April 28, 2010 at 23:34:50
thanks anyway for your help but unfortunately the trick does not work

special characters should be banned form the keyboard, I definitely hate them!


Report •

#3
April 29, 2010 at 00:02:12
Try:

chcp 1252
xcopy D:\gantt G:\Qualità\UIA\gantt\


Report •

Related Solutions

#4
April 29, 2010 at 00:03:52
i tested this on my XP:
pushd \work\librar?\test
:: ( where librar was "library") it will even allow you to stack them:
pushd G:\Qualit?\UIA\gantt\
::it got me there.. then you can resume navigation from
that point:
xcopy d:\gantt .

somebody really opened pandoras box when they did this crap.
imo, fnames should be 8 dot 3, but i will even swallow my stubborness and accept other formats, but PLEASE!!!
just: aA-zA and 0-9 plus MAYBE a very few others!
oh well, might as well plan on hit the lottery...

as usual, Judago first off the mark!


Report •

#5
April 29, 2010 at 00:13:35
@nbrane - Good idea using pushd and a wild card, it's bound to cause less issues than messing with the codepage.

Report •

#6
April 29, 2010 at 00:42:01
yes, it works!
thanks judago, but what is the trick?

mb


Report •

#7
April 29, 2010 at 00:48:21
thanks also to nbrane: wild card and pushd method works as well

Report •

#8
April 29, 2010 at 01:25:27
.... but what is the trick?

cmd generally uses one byte per character encoding leaving only 256 characters(including 00h) and some of these are generally non-printable control characters. The code page in use determines which characters are included and which values they map to.

chcp can be used to change the codepage.


Report •

#9
April 29, 2010 at 07:20:32
Judago & nbrane,

Pretty smoothy moves.

nbrane,

ROTFLMAO


=====================================
Helping others achieve escape felicity

M2


Report •

#10
April 29, 2010 at 11:44:56
Hi and thanks M2 ;)

Report •

#11
April 29, 2010 at 12:47:19
M2, get off the floor and stop laughing!
this forum needs dignified stuffed shirts, not laughter!

Report •

#12
April 29, 2010 at 13:42:27
just email me a dope-slap


=====================================
Helping others achieve escape felicity

M2


Report •

#13
May 1, 2010 at 04:01:34
CD also allows wildcards, but - as stated - I would not recommend any such actions, as you are never sure what will happen.

C:\>cd tem*

C:\Temp>cd
C:\Temp

C:\Temp>


Report •

#14
May 1, 2010 at 11:40:47
yeah, you could always try a pre-count, but then it starts getting cumbersome:
for /f %%a in ('dir /b /ad temp?. ^|find /i /v /c ""') do set cnt=%%a
if !cnt! neq 1 goto :fail

and that still leaves the question open...


Report •

#15
May 1, 2010 at 15:04:50
> and that still leaves the question open...

Whether the shortname maps to the correct full-name ? You can test this, there's a DIR parameter that shows the mapping between both. It's pretty complex, but it would work.


Report •

Ask Question