Jump to content

copy files with ACL ?


spuri
 Share

Recommended Posts

I need to copy files from network share to network share also also, I need use a different user account to have rights over the network share (need write right) and I need to copy the files with the NTFS rights.

my idea unsuccess:

runaswait, cmd, copy from unc path (fails), map share (fails from runaswait but works if i type in) , xcopy /T /E /O

How would you start?

Link to comment
Share on other sites

I need to copy files from network share to network share also also, I need use a different user account to have rights over the network share (need write right) and I need to copy the files with the NTFS rights.

my idea unsuccess:

runaswait, cmd, copy from unc path (fails), map share (fails from runaswait but works if i type in) , xcopy /T /E /O

How would you start?

Use RoboCopy instead of xcopy.

:)

Valuater's AutoIt 1-2-3, Class... Is now in Session!For those who want somebody to write the script for them: RentACoder"Any technology distinguishable from magic is insufficiently advanced." -- Geek's corollary to Clarke's law
Link to comment
Share on other sites

What is the difference? this is also does not work....

$uncPS = "\\server2\projects\_TemplateProject\Project_TMP\"

$uncCS = "\\server2\projects\_TemplateProject\Client_TMP\"

$uncT = "\\server2\projects\"

$nwclient ="test3"

Local $RunC = RunAsWait( $sUserName, $sDomain, $sPassword, 0, "robocopy "& $uncCS & " " & $uncT & $nwclient & "\ /E /COPY:DATS", @TempDir, @SW_MAXIMIZE )

Link to comment
Share on other sites

I don't want to set ACL for my deep folder tree, I want to copy my template folders with ACL.

Just do first FileCopy, then apply the CACLS (you can use cacls for non-recursive also... cacls /? in command prompt and you'll see all the functions)
Link to comment
Share on other sites

If you want to copy NTFS ACLs, then you have to access by the NTFS file system objects, which means as locally mounted drives, not as UNC share paths. I don't think you can see, let alone copy NTFS level permissions through the CIFS share.

:)

Valuater's AutoIt 1-2-3, Class... Is now in Session!For those who want somebody to write the script for them: RentACoder"Any technology distinguishable from magic is insufficiently advanced." -- Geek's corollary to Clarke's law
Link to comment
Share on other sites

Ok you are right. I tried to map network drive than copy, but mapping fails.

NET USE P: \\server2\projects\ && xcopy source target /E /T /S -

If I tried to open a cmd window with network admin user account, I am able to map and copy but this fails if I try to call all command in one line, like this example.

Local $RunC = RunAsWait($sUserName, $sDomain, $sPassword, 0, "cmd /k cd\ && NET USE P: \\server2\projects\", @SystemDir)

I got system error 67 - network drive not found

Please help :)

Edited by spuri
Link to comment
Share on other sites

  • Developers

to simplify things you could create a batch file in the script which contains the needed commands and then run that with RunAsWait()

Jos

SciTE4AutoIt3 Full installer Download page   - Beta files       Read before posting     How to post scriptsource   Forum etiquette  Forum Rules 
 
Live for the present,
Dream of the future,
Learn from the past.
  :)

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...