directory shell context menu item to rename file extensions


  1. Posts : 2
    Windows 7 Pro x64
       #1

    directory shell context menu item to rename file extensions


    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


  2. Posts : 5,092
    Windows 7 32 bit
       #2

    I would change it to simply "cmd.exe /k" to see what directory is the default then the prompt opens.
      My Computer


  3. Posts : 2
    Windows 7 Pro x64
    Thread Starter
       #3

    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


  4. Posts : 5,092
    Windows 7 32 bit
       #4

    Thanks for posting how you resolved it. That "pushd trick" looks generally useful. I'll add it to my tips file. :)
      My Computer


 

  Related Discussions
Our Sites
Site Links
About Us
Windows 7 Forums is an independent web site and has not been authorized, sponsored, or otherwise approved by Microsoft Corporation. "Windows 7" and related materials are trademarks of Microsoft Corp.

© Designer Media Ltd
All times are GMT -5. The time now is 21:04.
Find Us