Unable to device as Administrator
Posted on 2010-11-24
I have a weird issue. I have created a program that maps a drive to a folder using DefineDosDevice. The program works great as a standard user. I see the folder with the appropriate drive letter. Once I run the program as an administrator it won;t map the folder. Here is the function that does the work.
Private Function CreateDevice(DeviceName As String, PathName As String) As String
If DefineDosDevice(0, DeviceName, PathName) = 0 Then
MsgBox "Unable to create device " & DeviceName, vbCritical
CreateDevice = vbNullString
CreateDevice = DeviceName
How can I make it work as a standard user and a Administrator. Thanks.