Skip to content

Instantly share code, notes, and snippets.

@hyang0
Created June 1, 2015 09:19
Show Gist options
  • Save hyang0/1eeb1affd91e91ba73c7 to your computer and use it in GitHub Desktop.
Save hyang0/1eeb1affd91e91ba73c7 to your computer and use it in GitHub Desktop.
WinXP下获取目录的管理员权,使U盘中文件可读写。takeown.exe 文件可以从windows2003系统中找到,拷贝到xp的system32目录可即可用。
Windows Registry Editor Version 5.00
[HKEY_CLASSES_ROOT\*\shell\runas]
@="获取管理员权限"
"NoWorkingDirectory"=""
[HKEY_CLASSES_ROOT\*\shell\runas\command]
@="cmd.exe /c takeown /f \"%1\" & cacls \"%1\" /t /e /c /g administrators:F"
"IsolatedCommand"="cmd.exe /c takeown /f \"%1\" & cacls \"%1\" /t /e /c /g administrators:F"
[HKEY_CLASSES_ROOT\exefile\shell\runas2]
@="获取管理员权限"
"NoWorkingDirectory"=""
[HKEY_CLASSES_ROOT\exefile\shell\runas2\command]
@="cmd.exe /c takeown /f \"%1\" & cacls \"%1\" /t /e /c /g administrators:F"
"IsolatedCommand"="cmd.exe /c takeown /f \"%1\" & cacls \"%1\" /t /e /c /g administrators:F"
[HKEY_CLASSES_ROOT\Directory\shell\runas]
@="获取管理员权限"
"NoWorkingDirectory"=""
[HKEY_CLASSES_ROOT\Directory\shell\runas\command]
@="cmd.exe /c takeown /f \"%1\" /r /d y & cacls \"%1\" /t /e /c /g administrators:F"
"IsolatedCommand"="cmd.exe /c takeown /f \"%1\" /r /d y & cacls \"%1\" /t /e /c /g administrators:F"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment