Solved

Copy with permissions

Posted on 2011-09-26
6
292 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
How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

 
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

Free Gift Card with Acronis Backup Purchase!

Backup any data in any location: local and remote systems, physical and virtual servers, private and public clouds, Macs and PCs, tablets and mobile devices, & more! For limited time only, buy any Acronis backup products and get a FREE Amazon/Best Buy gift card worth up to $200!

Join & Write a Comment

Scenerio: You have a server running Server 2003 and have applied a retail pack of Terminal Server Licenses.  You want to change servers or your server has crashed and you need to reapply the Terminal Server Licenses. When you enter the 16-digit lic…
Restoring deleted objects in Active Directory has been a standard feature in Active Directory for many years, yet some admins may not know what is available.
Internet Business Fax to Email Made Easy - With eFax Corporate (http://www.enterprise.efax.com), you'll receive a dedicated online fax number, which is used the same way as a typical analog fax number. You'll receive secure faxes in your email, fr…
This video explains how to create simple products associated to Magento configurable product and offers fast way of their generation with Store Manager for Magento tool.

762 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

Need Help in Real-Time?

Connect with top rated Experts

18 Experts available now in Live!

Get 1:1 Help Now