Mapped Drives and Run As Administrator issue - Printable Version +- PowerBASIC Users Meeting Point (http://pump.richheimer.de) +-- Forum: User to User Discussions (http://pump.richheimer.de/forumdisplay.php?fid=3) +--- Forum: Programming (http://pump.richheimer.de/forumdisplay.php?fid=7) +--- Thread: Mapped Drives and Run As Administrator issue (/showthread.php?tid=24) |
Mapped Drives and Run As Administrator issue - Stuart McLachlan - 01-29-2025 Just ran into a little oops. Writing a small backup utility to copy files from a mapped drive to a USB Thumb Drive. I initially couldn't work out why it was silently failing with "Compile and Execute" I tried running the executable from Windows Explorer and it worked. Then it dawned on me : I have PBEdit and PBWin set to "run as Administrator' to avoid the known issues with occasional slow compilation and/or compiler fails. "Administrator " didn't have the drive mapping. My solution: Code: dwDrives = GetLogicalDrives RE: Mapped Drives and Run As Administrator issue - Raymond Leech - 01-29-2025 Stuart, I think this MS article fixes the problem of a network share in one context (elevated/normal) not appearing in the other context. https://learn.microsoft.com/en-us/troubleshoot/windows-client/networking/mapped-drives-not-available-from-elevated-command RE: Mapped Drives and Run As Administrator issue - Stuart McLachlan - 01-29-2025 (01-29-2025, 03:50 PM)Raymond Leech Wrote: Stuart, I think this MS article fixes the problem of a network share in one context (elevated/normal) not appearing in the other context. Yes, it does in certain situations, but those solutions are not applicable in the use case of the utility I was developing (for users on workstations in a network I have no control over). |