?
Solved

Copy with permissions

Posted on 2011-09-26
6
Medium Priority
?
304 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 4
  • 2
6 Comments
 
LVL 8

Accepted Solution

by:
Amitabh Singh earned 2000 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 2000 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
Interactive Way of Training for the AWS CSA Exam

An interactive way of learning that will help you visualize core concepts so that you can be more effective when taking your AWS certification exam.  Built for students by a student to help them understand the concepts that they are being taught.

 
LVL 8

Assisted Solution

by:Amitabh Singh
Amitabh Singh earned 2000 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 2000 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

What Is Blockchain Technology?

Blockchain is a technology that underpins the success of Bitcoin and other digital currencies, but it has uses far beyond finance. Learn how blockchain works and why it is proving disruptive to other areas of IT.

Question has a verified solution.

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

A quick step-by-step overview of installing and configuring Carbonite Server Backup.
This article shows how to deploy dynamic backgrounds to computers depending on the aspect ratio of display
Michael from AdRem Software explains how to view the most utilized and worst performing nodes in your network, by accessing the Top Charts view in NetCrunch network monitor (https://www.adremsoft.com/). Top Charts is a view in which you can set seve…
Sometimes it takes a new vantage point, apart from our everyday security practices, to truly see our Active Directory (AD) vulnerabilities. We get used to implementing the same techniques and checking the same areas for a breach. This pattern can re…
Suggested Courses

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