Skitty Posted March 2, 2011 Share Posted March 2, 2011 (edited) I have this script I made to enable my script to install procexp.exe in place of taskmgr.exe @SystemDir and I want to know how I could set the rights back to the new file after replacing it. Func _TAKEOWN($File) If StringInStr($File, " ") Then $I1 = 0 while 1 If $I1 >= 3 Then ExitLoop RunWait('TAKEOWN /F "' & $File & '"',"",@SW_HIDE) Sleep(2000) run('icacls "' & $File & '" /grant *S-1-1-0:(F,WDAC)',"",@SW_SHOW) $I1 += 1 WEnd Else $I2 = 0 While 1 If $I2 >= 3 Then ExitLoop RunWait('TAKEOWN /F ' & $File,"",@SW_HIDE) Sleep(2000) run('icacls ' & $File & ' /grant *S-1-1-0:(F,WDAC)',"",@SW_SHOW) $I2 += 1 WEnd EndIf FileSetAttrib($File,"-RSH") EndFunc Edited March 2, 2011 by System238 Link to comment Share on other sites More sharing options...
Skitty Posted March 2, 2011 Author Share Posted March 2, 2011 I have this script I made to enable my script to install procexp.exe in place of taskmgr.exe @SystemDir and I want to know how I could set the rights back to the new file after replacing it. Func _TAKEOWN($File) If StringInStr($File, " ") Then $I1 = 0 while 1 If $I1 >= 3 Then ExitLoop RunWait('TAKEOWN /F "' & $File & '"',"",@SW_HIDE) Sleep(2000) run('icacls "' & $File & '" /grant *S-1-1-0:(F,WDAC)',"",@SW_SHOW) $I1 += 1 WEnd Else $I2 = 0 While 1 If $I2 >= 3 Then ExitLoop RunWait('TAKEOWN /F ' & $File,"",@SW_HIDE) Sleep(2000) run('icacls ' & $File & ' /grant *S-1-1-0:(F,WDAC)',"",@SW_SHOW) $I2 += 1 WEnd EndIf FileSetAttrib($File,"-RSH") EndFunc Well, this is dumb... I just found out that there is an option in options to replace the task manager... Link to comment Share on other sites More sharing options...
rudi Posted March 2, 2011 Share Posted March 2, 2011 Hi. Well, this is dumb... I just found out that there is an option in options to replace the task manager... In case you should want to roll out this replacement, this is the value you need (beside pushing procexp.exe to %windir%): Windows Registry Editor Version 5.00 [HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Image File Execution Options\taskmgr.exe] "Debugger"="\"C:\\WINDOWS\\PROCEXP.EXE\"" Regards, Rudi. Earth is flat, pigs can fly, and Nuclear Power is SAFE! Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now