Created
May 3, 2018 22:16
-
-
Save neremin/fb5603d29b72c9db5cdc3dc24d0f2550 to your computer and use it in GitHub Desktop.
Total Commander portable registration (run from TCMD folder)
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
## Autorun script as Administrator | |
$admin = [Security.Principal.WindowsBuiltInRole] "Administrator" | |
$identity = [Security.Principal.WindowsPrincipal][Security.Principal.WindowsIdentity]::GetCurrent() | |
if (!$identity.IsInRole($admin)) { | |
Start-Process powershell.exe "-NoProfile -ExecutionPolicy Bypass -File `"$PSCommandPath`"" -Verb RunAs; exit | |
} | |
## Admin tasks | |
$tcmdDir = (Get-Item -Path $PSCommandPath).Directory.FullName | |
$regKey = "HKCU:\Software\Ghisler\Total Commander" | |
mkdir $regKey -force | Out-Null | |
sp $regKey -Name "IniFileName" -Value "$tcmdDir\wincmd.ini" | |
sp $regKey -Name "FtpIniName" -Value "$tcmdDir\wcx_ftp.ini" | |
sp $regKey -Name "InstallDir" -Value "$tcmdDir\" | |
Add-Type -AssemblyName PresentationFramework | |
[System.Windows.MessageBox]::Show("Total Commander installed!") | Out-Null |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment