Sunday, February 10, 2008

When is an Administrator not an Administrator

I am attempting to get a little in house command line maintenance utility working tonight on a new Vista 64 machine.

The program appeared to be having some problems accessing a temp directory; more on that later. So I opened up VS 2008. Not really knowing what type of debugging I would be doing to solve the problem, I chose to run it as an Administrator.

The program needs to access a network drive in order to copy over some backup files. The program was returning false on Folder.Exists() call!?!?!

A bit of searching later I discover that under Vista and VS when it is run as an Administrator any network drives are automatically disconnected. The trick is to either 'activate' the network drives by simply navigating to one by attempting to open a file or the like.

Fortunately if you exit VS and run it again as an Administrator it will remember the connection. I have not tested it after a reboot though.

Interesting, if you run VS not as an Administrator then you do not have the problem.

Very annoying.

No comments: