Solved

Copy with permissions

Posted on 2011-09-26
6
296 Views
Last Modified: 2012-05-12
We have a vb.net application to backup data in our server , but when the files are copied the permissions will not be retained.
Can anyone let me know how to copy data in VB.NET and retain the permissions.
0
Comment
Question by:winman_soft
  • 4
  • 2
6 Comments
 
LVL 8

Accepted Solution

by:
Amitabh Singh earned 500 total points
ID: 36597621
Hi
you can use robocopy for your program !

Example :
Process.Start("ROBOCOPY", "ROBOCOPY source destination /MIR  /SEC")

have a look to the post below how to run robocopy !
http://www.experts-exchange.com/OS/Microsoft_Operating_Systems/Server/2003_Server/Q_22041945.html?sfQueryTermInfo=1+10+30+ntf+permiss+robocopi

http://ss64.com/nt/robocopy.html
----------------------------------
and running DOS command in VB.NET
http://www.experts-exchange.com/Programming/Languages/.NET/Visual_Basic.NET/Q_21952833.html?sfQueryTermInfo=1+10+30+command+do+run+vb.net
0
 
LVL 8

Assisted Solution

by:Amitabh Singh
Amitabh Singh earned 500 total points
ID: 36597623

Example :
Process.Start("ROBOCOPY", "source destination /MIR  /SEC")
0
 

Author Comment

by:winman_soft
ID: 36599039
thanks for the reply..
Can it be done using GetAccessControl() and SetAccessControl()?
0
Netscaler Common Configuration How To guides

If you use NetScaler you will want to see these guides. The NetScaler How To Guides show administrators how to get NetScaler up and configured by providing instructions for common scenarios and some not so common ones.

 
LVL 8

Assisted Solution

by:Amitabh Singh
Amitabh Singh earned 500 total points
ID: 36599137
well nothing is impossible (you need to extract user/group setting one by one , set the output  to a variable and then apply this variable to destination location ), but i never did this via GetAccess/SetAccess because there is easy and fast methods are exist for this

their is one windows command xcopy which can do same thing for you
Example :
http://stackoverflow.com/questions/7520389/how-to-make-vbscript-copy-permissions-along-with-files
0
 

Author Comment

by:winman_soft
ID: 36707847
I had used xcopy for backup.. but it gave me some errors.
So, Can i copy only the permissions using xcopy?
0
 
LVL 8

Assisted Solution

by:Amitabh Singh
Amitabh Singh earned 500 total points
ID: 36709517
no you can not copy only permissions using xcopy (xcopy will copy data and permissions together )

but if you  just want to copy folder  permissions then you can use xcacls command

how to use xcalcs.vbs
http://support.microsoft.com/kb/825751

0

Featured Post

Backup Your Microsoft Windows Server®

Backup all your Microsoft Windows Server – on-premises, in remote locations, in private and hybrid clouds. Your entire Windows Server will be backed up in one easy step with patented, block-level disk imaging. We achieve RTOs (recovery time objectives) as low as 15 seconds.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

In my previous article (http://www.experts-exchange.com/Programming/Languages/.NET/.NET_Framework_3.x/A_4362-Serialization-in-NET-1.html) we saw the basics of serialization and how types/objects can be serialized to Binary format. In this blog we wi…
ADCs have gained traction within the last decade, largely due to increased demand for legacy load balancing appliances to handle more advanced application delivery requirements and improve application performance.
This Micro Tutorial will teach you how to censor certain areas of your screen. The example in this video will show a little boy's face being blurred. This will be demonstrated using Adobe Premiere Pro CS6.
With Secure Portal Encryption, the recipient is sent a link to their email address directing them to the email laundry delivery page. From there, the recipient will be required to enter a user name and password to enter the page. Once the recipient …

770 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question