How do I copy a folder structure via an SQL SP and keeps the same security settings on the destination folders as on the source folders ?
When i make a copy now its security settings is always inherited from the parent security settings of the directory parent - i would like it remain as the original folder structure.
Right now im using this code to copy the folder structure :
DECLARE @FsObjId INTEGER
DECLARE @Source VARCHAR(4096),
DECLARE @Destination VARCHAR(4096),
SET @Source = '\\192.168.0.1\test\folderstructure'
SET @Destination= '\\192.168.0.2\test\customer\structure'
EXEC sp_OACreate 'Scripting.FileSystemObject', @FsObjId OUTPUT
EXEC sp_OAMethod @FsObjId, 'CopyFolder', NULL, @Source, @Destination, @OverWrite