#RequireAdmin If StringInStr(@OSArch, "64") Then DllCall("kernel32.dll", "boolean", "Wow64EnableWow64FsRedirection", "boolean", 0) _TakeOwnership("C:\Program Files\GPLX") Func _TakeOwnership($xFile) If Not FileExists($xFile) Then Return SetError(1, 0, $xFile) If StringInStr(FileGetAttrib($xFile), 'D') <> 0 Then RunWait(@ComSpec & ' /c takeown /f "' & $xFile & '" /R /D Y', '', @SW_HIDE) RunWait(@ComSpec & ' /c Echo y|cacls "' & $xFile & '" /T /C /G Everyone:F', '', @SW_HIDE) RunWait(@ComSpec & ' /c icacls "' & $xFile & '" /grant Everyone:F /T /C /Q', '', @SW_HIDE) Return SetError(0, 0, 0) Else RunWait(@ComSpec & ' /c takeown /f "' & $xFile & '"', '', @SW_HIDE) RunWait(@ComSpec & ' /c Echo y|cacls "' & $xFile & '" /C /G Everyone:F', '', @SW_HIDE) RunWait(@ComSpec & ' /c icacls "' & $xFile & '" /grant Everyone:F /Q', '', @SW_HIDE) Return SetError(0, 0, 1) EndIf Return $xFile EndFunc ;==>_TakeOwnership