Solved directory shell context menu item to rename file extensions

slunt70

New member
Local time
3:31 AM
Messages
2
I have used the following registry mod successfully in win XP to add a right click option on a folder to rename m4a (AAC files) to m4b (bookmarked AAC files).

Windows Registry Editor Version 5.00

[HKEY_LOCAL_MACHINE\SOFTWARE\Classes\Directory\shell\m4b.m4a]
@="Rename m4a to m4b extensions"

[HKEY_LOCAL_MACHINE\SOFTWARE\Classes\Directory\shell\m4b.m4a\command]
@="cmd.exe /c \"rename *.m4a *.m4b\""

Unfortunately, it is not working in Windows 7 32 or 64 bit. If I open a command prompt in the folder, the rename command works as advertised, but for some reason it won't execute properly from the context menu based on the registry key.
 

My Computer My Computer

At a glance

Windows 7 Pro x64
Computer type
PC/Desktop
OS
Windows 7 Pro x64
I would change it to simply "cmd.exe /k" to see what directory is the default then the prompt opens.
 

My Computer My Computer

At a glance

Windows 7 32 bitAMD 5200+ dual core2 GBNVidia GeForce 6150SE 128 MB
Computer Manufacturer/Model Number
HP Media Center
OS
Windows 7 32 bit
CPU
AMD 5200+ dual core
Memory
2 GB
Graphics Card(s)
NVidia GeForce 6150SE 128 MB
Monitor(s) Displays
CRT
Screen Resolution
1280x1024
Hard Drives
500 GB Sata internal :

SIIG USB 3.0 docking stations w/WD Caviar Black 6 Gb/s drives
Keyboard
PS/2
Mouse
PS/2 Wheel Mouse
Other Info
SIIG USB 3.0 PCIexpress card.
Update:

Running the reg command without the terminate option (/c) showed a command prompt at the %windir%\system32 folder. So the command was executing, just in the wrong folder. Looking at the open-command-window-here reg setting, I saw that it uses the selected directory with the pushd "%V".
Apparently XP runs cmd.exe from the selected directory by default.

So I chained that command with the rename and viola it's working!

Here's the finished reg entry:

Windows Registry Editor Version 5.00

[HKEY_LOCAL_MACHINE\SOFTWARE\Classes\Directory\shell\m4b.m4a]
@="Rename m4a to m4b extensions"

[HKEY_LOCAL_MACHINE\SOFTWARE\Classes\Directory\shell\m4b.m4a\command]
@="cmd.exe /s /c pushd \"%V\" && rename *.m4a *.m4b"


MilesAhead had posted to this forum with the correct diagnostic before I had a chance to post the fix. Thanks for the help. It would have got me to the same point.
 

My Computer My Computer

At a glance

Windows 7 Pro x64
Computer type
PC/Desktop
OS
Windows 7 Pro x64
Thanks for posting how you resolved it. That "pushd trick" looks generally useful. I'll add it to my tips file. :)
 

My Computer My Computer

At a glance

Windows 7 32 bitAMD 5200+ dual core2 GBNVidia GeForce 6150SE 128 MB
Computer Manufacturer/Model Number
HP Media Center
OS
Windows 7 32 bit
CPU
AMD 5200+ dual core
Memory
2 GB
Graphics Card(s)
NVidia GeForce 6150SE 128 MB
Monitor(s) Displays
CRT
Screen Resolution
1280x1024
Hard Drives
500 GB Sata internal :

SIIG USB 3.0 docking stations w/WD Caviar Black 6 Gb/s drives
Keyboard
PS/2
Mouse
PS/2 Wheel Mouse
Other Info
SIIG USB 3.0 PCIexpress card.
Back
Top