-
Notifications
You must be signed in to change notification settings - Fork 6
/
PowerShellHereAsAdmin.inf
96 lines (81 loc) · 3.89 KB
/
PowerShellHereAsAdmin.inf
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
; //***************************************************************************
; // ***** Script Header *****
; // =======================================================
; // Elevation PowerToys for Windows Vista v1.1 (04/29/2008)
; // =======================================================
; //
; // "PowerShell Prompt Here as Administrator" PowerToy for Windows PowerShell 1.0
; //
; // File: PowerShellHereAsAdmin.inf
; //
; // Additional files required: PSAsAdmin.cmd, ElevationPowertoys.ico
; //
; // Purpose: To add a "PowerShell Prompt Here as Administrator" entry to the
; // Explorer context menu for Windows PowerShell 1.0 on Windows
; // Vista
; //
; // Additional requirement: "Elevate Command" PowerToy for Windows Vista
; // must be installed.
; //
; // Version: 1.0.1
; // Date : 04/29/2008
; //
; // History:
; // 1.0.0 01/15/2007 Created initial version.
; // 1.0.1 04/29/2008 Removed install of Elevate.cmd & Elevate.vbs to
; // Program Files\Elevate WSH Script PowerToy. Changed
; // Regsitry values to REG_EXPAND_SZ. Added
; // DisplayVersion, DisplayIcon, and version number to
; // DisplayName. Added installation of PSAsAdmin.cmd.
; //
; // ***** End Header *****
; //***************************************************************************
[version]
Signature="$Windows NT$"
[PowerShellHereAsAdminInstall]
CopyFiles = PowerShellHereAsAdmin.Files.Inf
CopyFiles = PowerShellHereAsAdmin.Files.System
CopyFiles = PowerShellHereAsAdmin.Files.Icon
AddReg = PowerShellHereAsAdmin.AddReg
[DefaultInstall]
CopyFiles = PowerShellHereAsAdmin.Files.Inf
CopyFiles = PowerShellHereAsAdmin.Files.System
CopyFiles = PowerShellHereAsAdmin.Files.Icon
AddReg = PowerShellHereAsAdmin.AddReg
[DefaultUnInstall]
DelFiles = PowerShellHereAsAdmin.Files.Inf
DelFiles = PowerShellHereAsAdmin.Files.System
DelReg = PowerShellHereAsAdmin.DelReg
[SourceDisksNames]
55="PowerShell Prompt Here as Administrator","",1
[SourceDisksFiles]
PowerShellHereAsAdmin.INF=55
ElevationPowertoys.ico=55
[DestinationDirs]
PowerShellHereAsAdmin.Files.Inf = 17
PowerShellHereAsAdmin.Files.System = 11
PowerShellHereAsAdmin.Files.Icon = 11
[PowerShellHereAsAdmin.Files.Inf]
PowerShellHereAsAdmin.INF
[PowerShellHereAsAdmin.Files.System]
PSAsAdmin.cmd
[PowerShellHereAsAdmin.Files.Icon]
ElevationPowertoys.ico
[PowerShellHereAsAdmin.AddReg]
HKLM,%UDHERE%,DisplayName,,"%DisplayName%"
HKLM,%UDHERE%,DisplayVersion,,"%DisplayVersion%"
HKLM,%UDHERE%,DisplayIcon,,"%11%\ElevationPowertoys.ico"
HKLM,%UDHERE%,UninstallString,,"rundll32.exe syssetup.dll,SetupInfObjectInstallAction DefaultUninstall 132 %17%\PowerShellHereAsAdmin.inf"
HKCR,Directory\Shell\PowerShellHereAsAdmin,,,"%PowerShellHereAsAdminAccel%"
HKCR,Directory\Shell\PowerShellHereAsAdmin\command,,0x00020000,"""%SystemRoot%\System32\cmd.exe"" /c Elevate.cmd ""%SystemRoot%\System32\windowspowershell\v1.0\powershell.exe"" -NoExit -Command Set-Location -LiteralPath '%L'; $host.ui.rawui.windowtitle = 'Administrator: ' + $host.ui.rawui.windowtitle"
HKCR,Drive\Shell\PowerShellHereAsAdmin,,,"%PowerShellHereAsAdminAccel%"
HKCR,Drive\Shell\PowerShellHereAsAdmin\command,,0x00020000,"""%SystemRoot%\System32\cmd.exe"" /c Elevate.cmd ""%SystemRoot%\System32\windowspowershell\v1.0\powershell.exe"" -NoExit -Command Set-Location -LiteralPath '%L'; $host.ui.rawui.windowtitle = 'Administrator: ' + $host.ui.rawui.windowtitle"
[PowerShellHereAsAdmin.DelReg]
HKLM,%UDHERE%
HKCR,Directory\Shell\PowerShellHereAsAdmin
HKCR,Drive\Shell\PowerShellHereAsAdmin
[Strings]
DisplayName="PowerShell Prompt Here as Administrator PowerToy for Windows PowerShell 1.0 on Windows Vista v1.0.1 (Uninstall only)"
DisplayVersion="1.0.1"
PowerShellHereAsAdminAccel="PowerShell Prompt Here as Administrator"
UDHERE="Software\Microsoft\Windows\CurrentVersion\Uninstall\PowerShellHereAsAdmin"