Using special characters when renaming file

Discussion forum for all Windows batch related topics.

Moderator: DosItHelp

Post Reply
Message
Author
keneo
Posts: 5
Joined: 12 Oct 2009 16:50

Using special characters when renaming file

#1 Post by keneo » 02 Dec 2009 16:39

I am trying to rename files in a batch.
But I want to use special characters in the file name like these ==> ♥♦♣♠
(ascii code 3,4,5 and 6)
Is there a way to insert these into a file name using batch commands?
Perhaps using a function that translates ascii code to a character?

BILL Dos
Posts: 12
Joined: 22 Sep 2009 11:49
Location: USA

#2 Post by BILL Dos » 02 Dec 2009 21:07

special characters and symbols would need the help of a 3rd party app just google around and should be something out there to help u ..

jeb
Expert
Posts: 1055
Joined: 30 Aug 2007 08:05
Location: Germany, Bochum

#3 Post by jeb » 04 Dec 2009 05:35

Hello keneo,

you can use chr.bat to build a file with ascii-characters (in hexformat)

call chr.bat 41
creates a chr.tmp file with one "B"

Code: Select all

@ECHO  off
setlocal

(
  echo a100
  echo db %~1
  echo.
  echo rcx
  echo 1
  echo w
  echo q
) | debug chr.tmp > NUL
for /f "tokens=*" %%l in (chr.tmp) do set chr=%%l

echo %chr%


hope it is useful
Jan Erik

Post Reply