Command Prompt Here

          Adding 'Command Prompt Here' link in the right click context menu in Windows XP facilitates opening 'command prompt' at desired folder.

How To Add 'Command Prompt Here' option:
          Open a notepad. Copy and paste the presented cmdph.bat code and save file as cmdph.bat. Now click Start->Run... to open Run dialog box. Type 'sendto' and press ENTER to open 'SendTo' folder. Now create a new shortcut. When it asks for location of file, click browse, locate cmdph.bat, select it and click 'OK'. Click next and type the name for the shortcut. Type this name as 'Command Prompt Here' and click finish. The icon of the shortcut is batfile icon. Note that the shortcut name and icon will appear in right click context menu when you right click on a file or folder and see 'send To' option. You can use any icon of your choice to decorate it.

cmdph.bat code

@echo off
dir /a:d /b %1 1>nul 2>nul
if %errorlevel%==0 goto pass
set parent="%~dp1"
echo %~nx1 is not a directory, redirecting to parent directory...
cd /d %parent%
goto allowed
cd /d %1

With this you can:

  1. Open command prompt at the specified folder with a right click.
  2. Open parent folder by right clicking a file in folder.
Advantages over other tools including Microsoft Powertoy:
  1. It handles folders with '&' in their name where Microsoft Powertoy gives error.
Related Posts:
Leave a comment

No comments:

Post a Comment