spuri Posted December 4, 2008 Share Posted December 4, 2008 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 More sharing options...
PsaltyDS Posted December 4, 2008 Share Posted December 4, 2008 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 More sharing options...
spuri Posted December 5, 2008 Author Share Posted December 5, 2008 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 More sharing options...
skysel Posted December 5, 2008 Share Posted December 5, 2008 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 /?. Link to comment Share on other sites More sharing options...
spuri Posted December 5, 2008 Author Share Posted December 5, 2008 I don't want to set ACL for my deep folder tree, I want to copy my template folders with ACL. Link to comment Share on other sites More sharing options...
skysel Posted December 5, 2008 Share Posted December 5, 2008 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 More sharing options...
spuri Posted December 5, 2008 Author Share Posted December 5, 2008 I am looking for copy solution! pls forget cacls I need to set different rights for all my directories Link to comment Share on other sites More sharing options...
PsaltyDS Posted December 5, 2008 Share Posted December 5, 2008 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 More sharing options...
spuri Posted December 5, 2008 Author Share Posted December 5, 2008 (edited) 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 December 5, 2008 by spuri Link to comment Share on other sites More sharing options...
Developers Jos Posted December 5, 2008 Developers Share Posted December 5, 2008 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 More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now