jamesstp20 0 Posted April 26, 2011 Hello, I would like to know how to remove or Move a protected file from WindowsDir. Like C:\Windows\System32\hal.dll Thanks you Share this post Link to post Share on other sites
PsaltyDS 39 Posted April 26, 2011 And you would be taking this ill-advised action because...? Valuater's AutoIt 1-2-3, Class... Is now in Session!For those who want somebody to write the script for them: RentACoder"Any technology distinguishable from magic is insufficiently advanced." -- Geek's corollary to Clarke's law Share this post Link to post Share on other sites
jamesstp20 0 Posted April 27, 2011 (edited) I would like to make something just like unlocker. That can remove any file but in autoit Edit: Everything work but I can't remove file from System32 dir because they are protected by "TrustedInstaller" but Unlocker works... How plz ? Edited April 27, 2011 by jamesstp20 Share this post Link to post Share on other sites
JScript 71 Posted April 27, 2011 If you change the title would look less "aggressive"... But why remove or move files "TrustedInstaller"?!?!?! http://forum.autoitbrasil.com/ (AutoIt v3 Brazil!!!)Somewhere Out ThereJames IngramDownload Dropbox - Simplify your life!Your virtual HD wherever you go, anywhere! Share this post Link to post Share on other sites
wakillon 403 Posted April 27, 2011 You need to change advanced security settings and be the owner of locked file ! Example found : #RequireAdmin Local $sFile = 'C:\SomePath\SomeFile.exe' File_Unlock($sFile) Func File_Unlock($sPath) If StringInStr(FileGetAttrib($sPath), 'D') Then Return SetError(-1) If StringInStr($sPath, '/') Then Return SetError(-2) If Not FileExists($sPath) Then Return SetError(-3) Local $exe = @ScriptDir & '\SetACL.exe' If Not FileExists($exe) Then Return SetError(-4) Local $cmd = $exe & ' -on "' & $sPath & '" -ot file' & _ ' -actn clear -clr "dacl,sacl"' & _ ' -actn setprot -op "dacl:np"' & _ ' -actn ace -ace "n:administrators;m:grant;p:full"' RunWait($cmd, @ScriptDir, @SW_HIDE) EndFunc AutoIt 3.3.14.2 X86 - SciTE 3.6.0 - WIN 8.1 X64 - Other Example Scripts Share this post Link to post Share on other sites
ricky 3 Posted August 18, 2011 Hello, it's possible to do the same for a folder? Please see this topic : Thanks for your help Share this post Link to post Share on other sites
Bert 1,430 Posted August 18, 2011 Just make a small adjustment to the code wakillon provided you. Have you tried to do that? The Vollatran project My blog: http://www.vollysinterestingshit.com/ Share this post Link to post Share on other sites
ricky 3 Posted August 19, 2011 Hello, yes, I tried it, but nothing change. I tried the code wakillon, but it doesn't work on Windows 7. Who can help me? Share this post Link to post Share on other sites