AskDirectory() Windows 8 Problem

Started by PaulSamuelson, June 28, 2013, 01:21:52 PM

Previous topic - Next topic

PaulSamuelson

I have code that has worked for years under Win2K through 7, but now has a problem with Windows 8.

AskDirectory() only shows local drives, not mapped network drives. Is there any way to change that?

in_Dir=AskDirectory("Please select a directory to import","",RawDir,"",0)

Thanks,

Paul Samuelson

Deana

Paul,

I wonder if you are dealing with a UAC issue. If User Account Control (UAC) is on and you are running as an administrator the script may not see some network locations.  Are you running the script in this context?

http://technet.microsoft.com/en-us/library/ee844140(v=ws.10).aspx

If so you might be able to change the manifest settings to affect what context the script sees: Standard user or Admin.

By Default WinBatch scripts run using the highest available elevation ( which for an admin account is the full administrator privileges). YOu can choose the use the manifest setting AsInvoker to runt he script using the standard user context ( where the drives were mapped I the first place )
Deana F.
Technical Support
Wilson WindowWare Inc.

td

It gets particularly tricky on Windows 8 when you are logged on as an administrator with the UAC prompt turned off and attempt to map a network drive.  This is because applications default to run with medium integrity level on Windows 8 even when UAC is off.  The only exception being that if the application is manifested to run as an administrator, it will run at high integrity level.  If you try to execute a '.wbt' file, it may not be able to see a drive even though you just mapped it. The .wbt file will be running at high integrity level because WinBatch.exe is manifested to run as an admin and you will more likely than not have been at the medium integrity level when you mapped the drive using a cmd prompt or the Explorer shell.
"No one who sees a peregrine falcon fly can ever forget the beauty and thrill of that flight."
  - Dr. Tom Cade

Gregory Miller

I was also having this problem with Windows Server 2012.  WinBatch would not work with mapped network drives.  After adding the EnableLinkedConnections parameter in RegEdit in the above mentioned article, all is well.