I do not get your question totally, but if it is about taking ownership of files, maybe this can help:
Hey, Scripting Guy! How Can I Take Ownership of a File or Folder By Using a Script?