• 0

Creating a directory on a shared drive


Question

I have a shared drive mapped to my local as drive Z. Using Windows Explorer, I can create directories in that folder all day long. The moment I try to add a directory from anywhere else, I get an error (a device attached to the system is not functioning). I'd ideally like to create the new directory from C# - which throws that same exception. I've tried xcopy and robocopy and both of those also fail with the same error.

 

So, does anyone know why creating a folder would work 100% of the time in explorer and 0% from anywhere else (including the most needed C# code)?

 

I've tried both of these to no avail

var di = new DirectoryInfo("z:\");
di.CreateSubDirectory("Test");


var di = new DirectoryInfo("\\servername\sharename\attachments\");
di.CreateSubDirectory("Test");

 

I've also tried (where test is the folder I'd like created)

xcopy file.txt z:\test\file.txt /T 
robocopy c:\ z:\test\ file.txt /COPY:DT

 

I've also done this with no happiness... Same error

c:\> z:
z:\> md test

 

 

If I navigate to either the Z drive or the share directly in Windows Explorer, I can right click and add a folder (and rename it).  I'm stumped.   I keep thinking its a permissions issue of some kind but then rationalize that Explorer and a command prompt are both running as my user (non-elevated) so how can permissions come into play.. 

 

Any one have any ideas?

 

 

    

0 answers to this question

Recommended Posts

There have been no answers to this question yet

This topic is now closed to further replies.