Wednesday, September 2, 2009

Add Command Prompt Here shortcut in the windows explorer menu

If you need to execute a command from a DOS shell and don't want to manually type your way through the path it's handy to have a command prompt here available in the Windows Explorer context menu.

This enables you to write click on a particular folder and select command prompt here in order to open in that folder.

Command-prompt-here.jpg

Copy the text between the *'s below into a text file using notepad and name it as CommandPromptHere.inf.

Then right click on the file and Select Install as shown…

install-inf-file.jpg

**********************

;
; "Command Prompt Here" PowerToy
;
; Copyright 1996 Microsoft Corporation
;
[version]
signature="$CHICAGO$"

[DosHereInstall]
CopyFiles = DosHere.Files.Inf
AddReg = DosHere.Reg

[DefaultInstall]
CopyFiles = DosHere.Files.Inf
AddReg = DosHere.Reg

[DefaultInstall.ntx86]
CopyFiles = DosHere.Files.Inf
AddReg = DosHere.Reg.NT

[DefaultUnInstall]
DelFiles = DosHere.Files.Inf
DelReg = DosHere.Reg

[DefaultUnInstall.ntx86]
DelFiles = DosHere.Files.Inf
DelReg = DosHere.Reg.NT

[SourceDisksNames]
55="DOS Prompt Here","",1

[SourceDisksFiles]
DOSHERE.INF=55

[DestinationDirs]
DosHere.Files.Inf = 17

[DosHere.Files.Inf]
DOSHERE.INF

[DosHere.Reg]
HKLM,%UDHERE%
HKLM,%UDHERE%,DisplayName,,"%DosHereName%"
HKLM,%UDHERE%,UninstallString,,"%10%\rundll.exe setupx.dll,InstallHinfSection DefaultUninstall 132 %17%\DosHere.inf"
HKCR,Directory\Shell\DosHere,,,"%DosHereAccel%"
HKCR,Directory\Shell\DosHere\command,,,"%10%\command.com /k cd ""%1″""
HKCR,Drive\Shell\DosHere,,,"%DosHereAccel%"
HKCR,Drive\Shell\DosHere\command,,,"%10%\command.com /k cd ""%1″""

[DosHere.Reg.NT]
HKLM,%UDHERE%
HKLM,%UDHERE%,DisplayName,,"%DosHereName%"
HKLM,%UDHERE%,UninstallString,,"rundll32.exe syssetup.dll,SetupInfObjectInstallAction DefaultUninstall 132 %17%\DosHere.inf"
HKCR,Directory\Shell\DosHere,,,"%DosHereAccel%"
HKCR,Directory\Shell\DosHere\command,,,"%11%\cmd.exe /k cd ""%1″""
HKCR,Drive\Shell\DosHere,,,"%DosHereAccel%"
HKCR,Drive\Shell\DosHere\command,,,"%11%\cmd.exe /k cd ""%1″""

[Strings]
DosHereName="Command Prompt Here PowerToy"
DosHereAccel="Command &Prompt Here"
UDHERE="Software\Microsoft\Windows\CurrentVersion\Uninstall\DosHere"

**********************

0 មតិយោបល់:

Post a Comment