Copy files as backup operator

Posted on 2008-06-19
Last Modified: 2013-12-04
In VB.Net I'm enumerating folders and files using DirectoryInfo.GetFiles(), and eventually I want to open and copy the contents of those files into a backup archive. When the program tries to access folders or files it does not have access to I get an Unauthorized Access Exception.

How can the program identify itself as a backup operator instead, so that I can access the files?
Question by:Frosty555
  • 3
  • 2
LVL 27

Expert Comment

ID: 21826322
You will have to have your network admin guy set you up with a special login name, and password for each of the directories you want to get to.
LVL 31

Author Comment

ID: 21831416
I am the network admin guy. Technically this is a product that will be installed on end user's machines.

Okay, so lets say I have a special user who is part of the backup operator's group (or administrator's group if that's necessary). How do I have use that user's credentials to perform the copy? Or how does VB.NET identify that it is performing a "backup" or "restore" operation as opposed to just opening the file and reading it?
LVL 27

Accepted Solution

planocz earned 500 total points
ID: 21831785
your right the program just runs the person that is login has to have administrator's group permission.
LVL 31

Author Comment

ID: 21837760
you can have a .net program execute using a different user's credentials somehow?
LVL 27

Expert Comment

ID: 21845838
I do not know few that can be done.

Featured Post

Free Trending Threat Insights Every Day

Enhance your security with threat intelligence from the web. Get trending threat insights on hackers, exploits, and suspicious IP addresses delivered to your inbox with our free Cyber Daily.

Join & Write a Comment

Suggested Solutions

Title # Comments Views Activity
.NET Error 7 42
How can I use this extension method? 8 36
Why is "packages element is not declared"? 2 39
Birthdays 3 0
Real-time is more about the business, not the technology. In day-to-day life, to make real-time decisions like buying or investing, business needs the latest information(e.g. Gold Rate/Stock Rate). Unlike traditional days, you need not wait for a fe…
OfficeMate Freezes on login or does not load after login credentials are input.
Here's a very brief overview of the methods PRTG Network Monitor ( offers for monitoring bandwidth, to help you decide which methods you´d like to investigate in more detail.  The methods are covered in more detail in o…
This video demonstrates how to create an example email signature rule for a department in a company using CodeTwo Exchange Rules. The signature will be inserted beneath users' latest emails in conversations and will be displayed in users' Sent Items…

757 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

16 Experts available now in Live!

Get 1:1 Help Now