Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save pwwang/12c0caee9ecc05838d6525d15fbfe370 to your computer and use it in GitHub Desktop.
Save pwwang/12c0caee9ecc05838d6525d15fbfe370 to your computer and use it in GitHub Desktop.

Revisions

  1. pwwang created this gist Jul 12, 2017.
    34 changes: 34 additions & 0 deletions Add_Open_Command_Window_Here_as_Administrator.reg
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,34 @@
    Windows Registry Editor Version 5.00

    ; Created by: Shawn Brink
    ; http://www.sevenforums.com
    ; Tutorial: http://www.sevenforums.com/tutorials/47415-open-command-window-here-administrator.html



    [-HKEY_CLASSES_ROOT\Directory\shell\runas]

    [HKEY_CLASSES_ROOT\Directory\shell\runas]
    @="Open CMD here (Admin)"
    "HasLUAShield"=""

    [HKEY_CLASSES_ROOT\Directory\shell\runas\command]
    @="cmd.exe /s /k pushd \"%V\""

    [-HKEY_CLASSES_ROOT\Directory\Background\shell\runas]

    [HKEY_CLASSES_ROOT\Directory\Background\shell\runas]
    @="Open CMD here (Admin)"
    "HasLUAShield"=""

    [HKEY_CLASSES_ROOT\Directory\Background\shell\runas\command]
    @="cmd.exe /s /k pushd \"%V\""

    [-HKEY_CLASSES_ROOT\Drive\shell\runas]

    [HKEY_CLASSES_ROOT\Drive\shell\runas]
    @="Open CMD here (Admin)"
    "HasLUAShield"=""

    [HKEY_CLASSES_ROOT\Drive\shell\runas\command]
    @="cmd.exe /s /k pushd \"%V\""
    7 changes: 7 additions & 0 deletions Add_Open_With_Notepad.reg
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,7 @@
    Windows Registry Editor Version 5.00

    [HKEY_LOCAL_MACHINE\SOFTWARE\Classes\*\shell]
    [HKEY_LOCAL_MACHINE\SOFTWARE\Classes\*\shell\OpenWithNotepad]
    @="Open with Notepad"
    [HKEY_LOCAL_MACHINE\SOFTWARE\Classes\*\shell\OpenWithNotepad\command]
    @="notepad.exe %1"
    7 changes: 7 additions & 0 deletions Alt-command-relocate.reg
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,7 @@
    Windows Registry Editor Version 5.00

    ; Relocate ALT and Command keys for windows on Mac

    [HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Keyboard Layout]
    "00000409"="KBDUS.DLL"
    "Scancode Map"=hex:00,00,00,00,00,00,00,00,02,00,00,00,5B,E0,38,00,38,00,5B,E0
    19 changes: 19 additions & 0 deletions Grant_Admin_Rights.reg
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,19 @@
    Windows Registry Editor Version 5.00
    [HKEY_CLASSES_ROOT\*\shell\runas]
    @="Grant Administrators Privileges"
    "NoWorkingDirectory"=""
    [HKEY_CLASSES_ROOT\*\shell\runas\command]
    @="cmd.exe /c takeown /f \"%1\" && icacls \"%1\" /grant administrators:F"
    "IsolatedCommand"="cmd.exe /c takeown /f \"%1\" && icacls \"%1\" /grant administrators:F"
    [HKEY_CLASSES_ROOT\exefile\shell\runas2]
    @="Grant Administrators Privileges"
    "NoWorkingDirectory"=""
    [HKEY_CLASSES_ROOT\exefile\shell\runas2\command]
    @="cmd.exe /c takeown /f \"%1\" && icacls \"%1\" /grant administrators:F"
    "IsolatedCommand"="cmd.exe /c takeown /f \"%1\" && icacls \"%1\" /grant administrators:F"
    [HKEY_CLASSES_ROOT\Directory\shell\runas]
    @="Grant Administrators Privileges"
    "NoWorkingDirectory"=""
    [HKEY_CLASSES_ROOT\Directory\shell\runas\command]
    @="cmd.exe /c takeown /f \"%1\" /r /d y && icacls \"%1\" /grant administrators:F /t"
    "IsolatedCommand"="cmd.exe /c takeown /f \"%1\" /r /d y && icacls \"%1\" /grant administrators:F /t"
    6 changes: 6 additions & 0 deletions Restart_Explorer.bat
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,6 @@
    @echo off
    color 2
    reg delete HKCR\lnkfile /v IsShortcut /f
    reg delete HKCR\piffile /v IsShortcut /f
    reg delete HKCR\InternetShortcut /v IsShortcut /f
    taskkill /f /im explorer.exe && explorer