Jump to content
Sign in to follow this  
spuri

copy files with ACL ?

Recommended Posts

spuri

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?

Share this post


Link to post
Share on other sites
PsaltyDS

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

Share this post


Link to post
Share on other sites
spuri

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 )

Share this post


Link to post
Share on other sites
skysel

You can always use CACLS.exe integrated windows command.

An example:

RunWait('CACLS "c:\program files\directory" /E /T /C /G "Users":F', '',@sw_hide)

browse google for parameters, or just type cacls /?.

Share this post


Link to post
Share on other sites
spuri

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

Share this post


Link to post
Share on other sites
skysel

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)

Share this post


Link to post
Share on other sites
spuri

I am looking for copy solution! pls forget cacls I need to set different rights for all my directories

Share this post


Link to post
Share on other sites
PsaltyDS

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

Share this post


Link to post
Share on other sites
spuri

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

Share this post


Link to post
Share on other sites
Jos

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

Jos


Visit the SciTE4AutoIt3 Download page for the latest versions  - Beta files                                How to post scriptsource        Forum Rules
 
Live for the present,
Dream of the future,
Learn from the past.
  :)

Share this post


Link to post
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
Sign in to follow this  

×

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.