Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save neremin/fb5603d29b72c9db5cdc3dc24d0f2550 to your computer and use it in GitHub Desktop.
Save neremin/fb5603d29b72c9db5cdc3dc24d0f2550 to your computer and use it in GitHub Desktop.
Total Commander portable registration (run from TCMD folder)
## 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