Skip to content

Instantly share code, notes, and snippets.

@RobertBernstein
Created September 27, 2015 21:09
Show Gist options
  • Save RobertBernstein/c4a645ba40401e98818d to your computer and use it in GitHub Desktop.
Save RobertBernstein/c4a645ba40401e98818d to your computer and use it in GitHub Desktop.
;
; "PowerShell Here" PowerToy
;
; Copyright 2006 Scott Hanselman
; http://www.computerzen.com
;
; Modified using the VS2003 Command Shell Here tool as a template May 4, 2006
;
; Copyright 2015 Robert Bernstein
; http://www.tardistech.com
; Modified again to add PowerShell Here (Admin) on September 27th, 2015.
; Used http://vlaurie.com/computers2/Articles/inf-file.htm as a reference.
;
[version]
signature="$WINDOWS NT$"
[PowerShellHereInstall]
CopyFiles = PowerShellHere.Files.Inf
AddReg = PowerShellHere.Reg
[DefaultInstall]
CopyFiles = PowerShellHere.Files.Inf
AddReg = PowerShellHere.Reg
[DefaultUnInstall]
DelFiles = PowerShellHere.Files.Inf
DelReg = PowerShellHere.Reg
[SourceDisksNames]
55="PowerShell Prompt Here","",1
[SourceDisksFiles]
PowerShellHere.INF=55
[DestinationDirs]
PowerShellHere.Files.Inf = 17
[PowerShellHere.Files.Inf]
PowerShellHere.INF
[PowerShellHere.Reg]
HKLM,%UDHERE%,DisplayName,,"%PowerShellHereName%"
HKLM,%UDHERE%,Publisher,,"%TardisTechnologies%"
HKLM,%UDHERE%,DisplayVersion,,"%DisplayVersion%"
HKLM,%UDHERE%,DisplayIcon,,""C:\WINDOWS\system32\windowspowershell\v1.0\powershell.exe""
HKLM,%UDHERE%,UninstallString,,"rundll32.exe syssetup.dll,SetupInfObjectInstallAction DefaultUninstall 132 %17%\PowerShellHere.inf"
HKCR,Directory\Shell\PowerShellHere
HKCR,Directory\Shell\PowerShellHere,,,"%PowerShellHereAccel%"
HKCR,Directory\Shell\PowerShellHere\command
HKCR,Directory\Shell\PowerShellHere\command,,,"""C:\WINDOWS\system32\windowspowershell\v1.0\powershell.exe"" -NoExit -Command Set-Location -LiteralPath '%L'"
HKCR,Directory\Shell\runas,,,"%PowerShellHereAdminAccel%"
HKCR,Directory\Shell\runas,HasLUAShield
HKCR,Directory\Shell\runas\command
HKCR,Directory\Shell\runas\command,,,"""C:\WINDOWS\system32\windowspowershell\v1.0\powershell.exe"" -NoExit -Command Set-Location -LiteralPath '%L'"
HKCR,Directory\Background\Shell\runas,,,"%PowerShellHereAdminAccel%"
HKCR,Directory\Background\Shell\runas,HasLUAShield
HKCR,Directory\Background\Shell\runas\command
HKCR,Directory\Background\Shell\runas\command,,,"""C:\WINDOWS\system32\windowspowershell\v1.0\powershell.exe"" -NoExit -Command Set-Location -LiteralPath '%L'"
HKCR,Drive\Shell\PowerShellHere
HKCR,Drive\Shell\PowerShellHere,,,"%PowerShellHereAccel%"
HKCR,Drive\Shell\PowerShellHere\command
HKCR,Drive\Shell\PowerShellHere\command,,,"""C:\WINDOWS\system32\windowspowershell\v1.0\powershell.exe"" -NoExit ""cd '%1'"""
HKCR,Drive\Shell\runas,,,"%PowerShellHereAdminAccel%"
HKCR,Drive\Shell\runas,HasLUAShield
HKCR,Drive\Shell\runas\command
HKCR,Drive\Shell\runas\command,,,"""C:\WINDOWS\system32\windowspowershell\v1.0\powershell.exe"" -NoExit -Command Set-Location -LiteralPath '%L'"
[Strings]
TardisTechnologies="Tardis Technologies"
DisplayVersion="1.1"
PowerShellHereName="PowerShell Prompt Here Shell Extension"
PowerShellHereAccel="&PowerShell Prompt Here"
PowerShellHereAdminAccel="&PowerShell Prompt Here (Admin)"
UDHERE="Software\Microsoft\Windows\CurrentVersion\Uninstall\PowerShellHere"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment