bguenther
asked on
How to Overwrite a file in c:\windows..... backup permissions restore permissions
Hi Everyone,
i am trying to create a function where i can specify a source file and a target file.
I want to store the permissions that the target file has and backup the target file.
Copy the source file to the target files location and name.
Set permissions for the new file to match the old file (eg System, Trusted Installer etc....)
The file copying is pretty simple but i don't how to get permission for the file or set them on the new file.
Can anyone help with this?
Also being allowed to copy to a location like: C:\windows\winsxs\wow64_mi crosoft-wi ndows-a..c ing-infras tructure_3 1bf3856ad3 64e35_6.1. 7600.16385 _none_0bfc c31f07a61f 6d\
'Create backup
System.IO.File.Move(strTar getFile, strTargetFile & ".bak")
'Copy file
System.IO.File.Copy(strSou rceFile, strTargetFile)
i am trying to create a function where i can specify a source file and a target file.
I want to store the permissions that the target file has and backup the target file.
Copy the source file to the target files location and name.
Set permissions for the new file to match the old file (eg System, Trusted Installer etc....)
The file copying is pretty simple but i don't how to get permission for the file or set them on the new file.
Can anyone help with this?
Also being allowed to copy to a location like: C:\windows\winsxs\wow64_mi
'Create backup
System.IO.File.Move(strTar
'Copy file
System.IO.File.Copy(strSou
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER