[Okta Webinar] Learn how to a build a cloud-first strategyRegister Now

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 322
  • Last Modified:

Directory.CreateDirectory issues

I have a two part question. If I am trying to access a non shared drive on a server such as
\\server\c$
What is this called (the c$). Also it would appear that I can't programatically create a new directory at
\\server\c$\newDirectory

Obviously if I went in and created a new directory and then shared it I could access it like
\\server\sharedDirectory\newDirectory

But I would rather be able to deal with the more ambiguous case using the c$ (I can't for the life of me remember what that is reffered to).

So anyway I am trying to programatically check to see if a directory exists at
\\server\c$\directoryInQuestion
, if it doesn't I want to create a new directory at the location
\\server\c$\directoryInQuestion

Any help (and the term that is used to describe drive access using that $) would be fantastic.

Thanks,
Patrick
0
Naanan
Asked:
Naanan
  • 2
1 Solution
 
WilliamCommented:
You have to remember that the application will need admin rights to the c$ drive (no matter where it is located)
Also the call
Directory.Create will work as you plan...
Just remember to create your string:
@"\\myserver\c$\directory"
or
"\\\\myserver\\c$\\directory"

0
 
NaananAuthor Commented:
Thanks, if the application is running under my credentials and I have admin access to the c$ drive then it should be all good correct?
0
 
WilliamCommented:
Correct
But remember if it is running under someone elses it may fail...
If this is for your use only... no problem that I can see
0

Featured Post

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now