ma**********@gmail.com wrote:
This may be a permission/mapping problem most likely due to the fact
that the printer driver is spawning the application under a different
user/credentials.
You may need to use WindowsIdentity.Impersonate to impersonate a
windows user with higher authentication and/or a Windows user that has
the drive mapped
So I've been running some tests to figure out what the issue is and I'm
confounded about one portion of it. I created a C# test program which
prints the following to a textbox:
textBox1.Text += "Z Directory exists: " + Directory.Exists("z:\\") + "\r\n";
textBox1.Text += "\\\\wing\\data Directory exists: " +
Directory.Exists("\\\\wing\\data") + "\r\n";
textBox1.Text += "User: " + WindowsIdentity.GetCurrent().Name + "\r\n";
textBox1.Text += "Is Auth: " +
WindowsIdentity.GetCurrent().IsAuthenticated + "\r\n";
textBox1.Text += "Is System: " +
WindowsIdentity.GetCurrent().IsSystem + "\r\n";
I've mapped \\wing\data to z:, so I would expect the same output for
both Directory.Exists("z:\\") and Directory.Exists("\\\\wing\\data").
And it does - but as soon as I throw an impersonate() in there - even if
I'm impersonating myself, Z:\ doesn't exist but \\\\wing\\data does.
Output before impersonating myself:
Z Directory exists: True
\\wing\data Directory exists: True
User: DELL\Dan
Is Auth: True
Is System: False
Output after impersonating myself:
Z Directory exists: False
\\wing\data Directory exists: True
User: DELL\Dan
Is Auth: True
Is System: False
Why does Z:\ cease to exist!?
Bonus question: is it possible to give the NT SYSTEM account access to
z:\? Thanks,
- Dan