我正在努力让它正常工作。这个 .reg 导入时在表面上工作,但是在执行时我会收到“此安全 ID 可能未分配为此对象的所有者”的问候
我认为这是由于 cmd 没有以管理员身份启动。有人可以就更改命令提出建议吗?我相信从过去遇到类似要求的情况下,您必须先使用 powershell 打开 cmd 之类的?
这是注册文件
[HKEY_CLASSES_ROOT\*\shell\RestoreOwnership]
"HasLUAShield"=""
"MUIVerb"="Restore Ownership"
"NoWorkingDirectory"=""
"NeverDefault"=""
"SubCommands"=""
[HKEY_CLASSES_ROOT\*\shell\RestoreOwnership\Shell]
[HKEY_CLASSES_ROOT\*\shell\RestoreOwnership\Shell\RestoreOwnershipSYSTEM]
"HasLUAShield"=""
"MUIVerb"="Restore to System"
[HKEY_CLASSES_ROOT\*\shell\RestoreOwnership\Shell\RestoreOwnershipSYSTEM\command]
@="cmd.exe /c icacls \"%1\" /setowner \"SYSTEM\" /t /c & pause"
"IsolatedCommand"="cmd.exe /c icacls \"%1\" /setowner \"SYSTEM\" /t /c & pause"
[HKEY_CLASSES_ROOT\*\shell\RestoreOwnership\Shell\RestoreOwnershipTrustedInstaller]
"HasLUAShield"=""
"MUIVerb"="Restore to TrustedInstaller"
[HKEY_CLASSES_ROOT\*\shell\RestoreOwnership\Shell\RestoreOwnershipTrustedInstaller\command]
@="cmd.exe /c icacls \"%1\" /setowner \"NT Service\\TrustedInstaller\" /t /c & pause"
"IsolatedCommand"="cmd.exe /c icacls \"%1\" /setowner \"NT Service\\TrustedInstaller\" /t /c & pause"
[HKEY_CLASSES_ROOT\Directory\shell\RestoreOwnership]
"HasLUAShield"=""
"MUIVerb"="Restore Ownership"
"NoWorkingDirectory"=""
"NeverDefault"=""
"SubCommands"=""
[HKEY_CLASSES_ROOT\Directory\shell\RestoreOwnership\Shell]
[HKEY_CLASSES_ROOT\Directory\shell\RestoreOwnership\Shell\RestoreOwnershipSYSTEM]
"HasLUAShield"=""
"MUIVerb"="Restore to System"
[HKEY_CLASSES_ROOT\Directory\shell\RestoreOwnership\Shell\RestoreOwnershipSYSTEM\command]
@="cmd.exe /c icacls \"%1\" /setowner \"SYSTEM\" /t /c & pause"
"IsolatedCommand"="cmd.exe /c icacls \"%1\" /setowner \"SYSTEM\" /t /c & pause"
[HKEY_CLASSES_ROOT\Directory\shell\RestoreOwnership\Shell\RestoreOwnershipTrustedInstaller]
"HasLUAShield"=""
"MUIVerb"="Restore to TrustedInstaller"
[HKEY_CLASSES_ROOT\Directory\shell\RestoreOwnership\Shell\RestoreOwnershipTrustedInstaller\command]
@="cmd.exe /c icacls \"%1\" /setowner \"NT Service\\TrustedInstaller\" /t /c & pause"
"IsolatedCommand"="cmd.exe /c icacls \"%1\" /setowner \"NT Service\\TrustedInstaller\" /t /c & pause"
好吧,我有一个系统工作
[HKEY_CLASSES_ROOT\*\shell\RestoreOwnership]
"MUIVerb"="Restore Ownership"
"HasLUAShield"=""
"SubCommands"=""
[HKEY_CLASSES_ROOT\*\shell\RestoreOwnership\shell\RestoreOwnershipSYSTEM]
@="Restore Ownership SYSTEM"
"HasLUAShield"=""
[HKEY_CLASSES_ROOT\*\shell\RestoreOwnership\shell\RestoreOwnershipSYSTEM\command]
@="powershell -windowstyle hidden -command \"Start-Process cmd -ArgumentList '/c icacls \\\"%1\\\" /setowner \"SYSTEM\" /t /c /l & pause' -Verb runAs\""
"IsolatedCommand"="powershell -windowstyle hidden -command \"Start-Process cmd -ArgumentList '/c icacls \\\"%1\\\" /setowner \"SYSTEM\" /t /c /l & pause' -Verb runAs\""
[HKEY_CLASSES_ROOT\*\shell\RestoreOwnership\shell\RestoreOwnershipTrustedInstaller]
@="Restore Ownership TrustedInstaller"
"HasLUAShield"=""
[HKEY_CLASSES_ROOT\*\shell\RestoreOwnership\shell\RestoreOwnershipTrustedInstaller\command]
@="powershell -windowstyle hidden -command \"Start-Process cmd -ArgumentList '/c icacls \\\"%1\\\" /setowner \"NT Service\\TrustedInstaller\" /t /c /l & pause' -Verb runAs\""
"IsolatedCommand"="powershell -windowstyle hidden -command \"Start-Process cmd -ArgumentList '/c icacls \\\"%1\\\" /setowner \"NT Service\\TrustedInstaller\" /t /c /l & pause' -Verb runAs\""
不幸的是,TrustedInstaller 仍然面临着
Invalid parameter "Service\TrustedInstaller"
我知道它必须是一些愚蠢的简单的东西,我错过了那个......
最终答案。一切都围绕着格式化。