Convert "hex" foldername to "ascii"

So, I have a folder, containing subdirs like this:

 52334d50 
 52365245 
524b4450
524f3350 
52533950 
52535050 
52555550 

now I want to go ahead and rename all those folder:

hex -> ascii

 f.e. 52334d50 becomes: R3MP 

Any way to get cmd / powershell to do this ?

Thanks in advance

Yes of course "there is a way to do this".

We are not a free shell script writing service and are here to help you write YOUR scripts and to teach you how to solve your own problems.

Please show YOUR work. What have you coded and tried so far?!

In Unix in bash or zsh you can convert a hex number to ascii character with e.g.

printf "\x52\n"

Provided the ls command displays the current names, you can display the ascii names with

ls | sed 's/../\\\\x&/g' | while read f; do printf "$f\n"; done

But I cannot help with cmd and powershell.

No problem. That is more than enough of a hint.

Thanks ! :).

To do this task is not trivial in CMD.EXE, I don't know about PowerShell.
(Boy oh boy, the last time I did a '.BAT' file was in 2013 in AudioScope.sh.)

Here is the method used in CMD.EXE translated to UNIX.
Inside the code are the two main batchfile lines to do the task from decimal to character.

#!/usr/local/bin/dash
# Quick and dirty convert hex to char to demonstrate the Windows CMD.EXE method.

# Hex value '0x41' is 'A'.
HEXVAL="41"
DECIVAL=$( printf "%d" "0x${HEXVAL}" )
/usr/local/bin/dash -c "exit ${DECIVAL}"
RC=$?
CHAR=$( printf \\$( printf "%o" "${RC}" ) )
echo "${CHAR}"

# REM Windows CMD.EXE "terminal", (might even work in COMMAND.COM for 32 bit Windows).
# REM A starter to get a quick and dirty ASCII character from decimal.
# REM Converting hex to decimal is just a couple of lines away.
# REM Looping through each hex pair should be easy.
#
# CMD.EXE /C EXIT 65
# ECHO %=exitcodeAscii%

Result of the demo, OSX 10.14.3, default bash terminal calling 'dash'.

Last login: Wed Sep  4 20:04:57 on ttys000
AMIGA:amiga~> cd Desktop/Code/Shell
AMIGA:amiga~/Desktop/Code/Shell> ./hex_char.sh
A
AMIGA:amiga~/Desktop/Code/Shell> _

(I have actually used the RC method for peeking memory on the AMIGA in Python.)
Have fun...

The previous post boils down to

printf "$(printf "\\%o" 0x41)\n"

So converting the filenames with dash (or ksh) is

ls | sed 's/../ 0x&/g' | while read a; do printf "$(printf "\\%o" $a)\n"; done

Hi MadeInGermany...

Absolutely - BUT - we are talking about Windows here and not UNIX, and the OP wanted it in Windows CMD[.EXE] or PowerShell.
I was showing the procedure, (rigmarole), as close as possible using a UNIX script. I can't remember the full sequence because it was years ago when I did it, but at least this is a starter.
In those days one had to convert any HEX to DECIMAL to be inserted into the EXIT code and I am sure you still have to do it that way...
SETting the variables, converting from hex to deci, and FOR loops in a FILE.BAT script should be second nature for a CMD.EXE batch file expert.

As I quoted, paraphrasing, "doing it in a CMD.EXE CLI is NOT trivial"...
AS I quoted before I don't know about PowerShell as I never really got into it, as, much like a standard batch file, IMHO, it is convoluted to code with.

To round this up, here are what others came up with aswell (Powershell):

Thanks for the amazing input !

for Hi pasc...

Glad you have got a starter solution.
Remember though that there might be a reason the drawer names are in base 16 format.
Perhaps there could possibly be special characters in the drawer name that can't be used so base16 is an easy way around the problem.
Also although in Windows there is no case sensitivity in file and drawer names there IS in the *NIX variants so:
'af' is NOT the same as 'Af', 'AF' or 'aF'...

Just an observation.

Bazza...