In my SF9.5 project, I'm trying to take ownership of an existing file, so I can replace it with a different one. I know how to do it manually by going to File Properties, Security tab, Advanced, Owner tab, then Edit. But I'm not sure what processing in SF9.5 would allow me to do this. I have used and am slightly familiar with REGINI.EXE, if this is the way to do it, but I thought I'd make a post to see if there is a nice and easy way to do it in SF. Thanks, MikeT
Announcement
Collapse
No announcement yet.
How do I Take Ownership of an existing file
Collapse
X
-
-
-
Thanks Ulrich. That worked well. Syntax I used was:
-- Take Ownership of MyFile.exe[/COLOR]
Shell.Execute(_SystemFolder.."\\takeown.exe", "open", "/F "..SessionVar.Expand("%AppFolder%\\MyFile.exe" ).." /A", "_SystemFolder..", SW_HIDE, true);
-- Set Permissions for Administrators for Full Access.
File.SetPermissions(SessionVar.Expand("%AppFolder% \\MyFile.exe"), SID_ADMINISTRATORS, SET_ACCESS, ALL_PERMISSIONS, SUB_CONTAINERS_AND_OBJECTS_INHERIT);
Comment
Comment