Code
:: Add List Permissions Context Menu in Windows
@Echo Off
Cls
net sess>nul 2>&1||(start mshta vbscript:code(close(Execute("CreateObject(""Shell.Application"").ShellExecute""%~0"",,,""RunAs"",1"^)^)^)&exit)
Cls & Mode CON LINES=11 COLS=65 & Color 0E & Title Created By FreeBooter
Echo.
Echo.
Echo.
Echo.
Echo Add "List Permissions" to Context Menu (Y/N)?
Echo.
Echo.
Echo.
Set /p input= RESPONSE:
If /i Not %input%==Y (Goto :_Ex) Else (Goto :_Start)
:_Ex
If /i Not %input%==N (Goto :EOF) Else (Goto :_RegRestore)
:_Start
Reg.exe add "HKCR\*\shell\ListPermissions" /v "MUIVerb" /t REG_SZ /d "List Permssions" /f
Reg.exe add "HKCR\*\shell\ListPermissions\command" /ve /t REG_SZ /d "powershell -NoExit Get-ACL '%%1' | Format-List" /f
Reg.exe add "HKCR\Directory\shell\ListPermissions" /v "MUIVerb" /t REG_SZ /d "List Permssions" /f
Reg.exe add "HKCR\Directory\shell\ListPermissions" /v "SubCommands" /t REG_SZ /d "" /f
Reg.exe add "HKCR\Directory\shell\ListPermissions\shell\001flyout" /v "MUIVerb" /t REG_SZ /d "List permssions of this folder only" /f
Reg.exe add "HKCR\Directory\shell\ListPermissions\shell\001flyout\command" /ve /t REG_SZ /d "powershell -NoExit Get-ACL '%%1' | Format-List" /f
Reg.exe add "HKCR\Directory\shell\ListPermissions\shell\002flyout" /v "MUIVerb" /t REG_SZ /d "List permssions of subfolders and files" /f
Reg.exe add "HKCR\Directory\shell\ListPermissions\shell\002flyout\command" /ve /t REG_SZ /d "powershell -NoExit Get-ChildItem '%%1' -Recurse | Get-ACL | Format-List" /f
Reg.exe add "HKCR\Directory\shell\ListPermissions\shell\003flyout" /v "MUIVerb" /t REG_SZ /d "List permssions of subfolders and files to .txt file on desktop" /f
Reg.exe add "HKCR\Directory\shell\ListPermissions\shell\003flyout\command" /ve /t REG_SZ /d "powershell Get-ChildItem '%%1' -Recurse | Get-ACL | Format-List | Out-File \"$env:userprofile\Desktop\Permissions.txt\"" /f
Cls & Mode CON LINES=11 COLS=65 & Color 0E & Title Created By FreeBooter
Echo.
Echo.
Echo.
Echo.
Echo Adding "List Permissions" to Context Menu
Echo.
Echo.
Echo.
Ping -n 6 localhost >Nul
Exit
:_RegRestore
Reg.exe delete "HKCR\*\shell\ListPermissions" /f
Reg.exe delete "HKCR\Directory\shell\ListPermissions" /f
Cls & Mode CON LINES=11 COLS=65 & Color 0E & Title Created By FreeBooter
Echo.
Echo.
Echo.
Echo.
Echo Removing "List Permissions" from Context Menu
Echo.
Echo.
Echo.
Ping -n 6 localhost >Nul
Exit
