WinBatch® Technical Support Forum

All Things WinBatch => WinBatch => Topic started by: kerdweg on December 11, 2020, 05:55:05 AM

Title: Webdav Drive not accessable
Post by: kerdweg on December 11, 2020, 05:55:05 AM
I try to read data from drive, connected via webdav.

But I always get th error "1028 Logdisk: Angefordertes Laufwerk ist nicht Online".

Can anybody help me what to do?
Title: Re: Webdav Drive not accessable
Post by: ChuckC on December 11, 2020, 06:44:46 AM
Are you able to open a console window [CMD.EXE] and successfully use the DIR command get a directory listing of the WebDAV drive?

IIRC, not all WebDAV support is implemented as a network provider and exists solely within the Windows Explorer shell as a shell extension.  If that's what you have, then WinBatch is very likely not going to be able to interact with it.

If your WebDAV support is implemented as a network provider and you have a drive letter mapped to it, then please confirm what your UAC settings are and whether the drive letter is being mapped by a process using the "restricted" access token while your script is running using the "elevated" access token such that it cannot see the mapped drive.  By default, the "restricted" and "elevated" access tokens have separate mapped network drives that are not visible across the boundary imposed by UAC.  There is a registry setting you can enable that permits the sharing of network drives between the "restricted" and "elevated" access tokens.

Title: Re: Webdav Drive not accessable
Post by: kerdweg on December 11, 2020, 07:01:21 AM
Thanks for your fast answer.
I am able to open a console and access the mapped drive letter within this command line.
The DIR command lists me the content.

I don't really understand how to enable winbatch to see the mapped network drive with the access token.
What do I have to do?
Is the only way to set a registry key? And what key do I have to set?

Title: Re: Webdav Drive not accessable
Post by: td on December 11, 2020, 07:40:56 AM
This issue is covered in the Tech Database and no you don't have to set a registry key.  Assuming that the access token is the issue (it almost always is with mapped drives), you can run your WinBatch script as a restricted Admin (asInvoker) or map the drive using an Elevated admin process. 

Tech DB articles

Mapped drive issue:
https://techsupt.winbatch.com/webcgi/webbatch.exe?techsupt/nftechsupt.web+WinBatch/UAC+Mapped~Drives~Issue~with~UAC.txt (https://techsupt.winbatch.com/webcgi/webbatch.exe?techsupt/nftechsupt.web+WinBatch/UAC+Mapped~Drives~Issue~with~UAC.txt)

Running under UAC:
https://techsupt.winbatch.com/webcgi/webbatch.exe?techsupt/nftechsupt.web+~+Run~Scripts~on~Windows~Vista~and~Newer.txt (https://techsupt.winbatch.com/webcgi/webbatch.exe?techsupt/nftechsupt.web+~+Run~Scripts~on~Windows~Vista~and~Newer.txt)
Title: Re: Webdav Drive not accessable
Post by: td on December 11, 2020, 08:03:54 AM
Discovered something new... I may be the only person that visits this forum that didn't know it but Windows 10 has built-in support for mapping drives using the Webdav protocol.   
Title: Re: Webdav Drive not accessable
Post by: ChuckC on December 11, 2020, 08:43:45 AM
yeah, somewhere along the way WebDAV support went from a very thin shell-extension purely usable within the Windows Explorer for drag-n-drop that simply moved files between local & remote storage to being an actual network provider like the SMB/CIFS client.

nifty, huh?
Title: Re: Webdav Drive not accessable
Post by: td on December 11, 2020, 01:20:30 PM
A closer examination of any underlying APIs that support that feature is in order...
Title: Re: Webdav Drive not accessable
Post by: td on December 11, 2020, 01:28:00 PM
There appears to be a set of Win32 functions in Vista and new versions of Windows.  The API is exported by the Netapi32 dll. Cool.
Title: Re: Webdav Drive not accessable
Post by: ChuckC on December 12, 2020, 04:20:56 AM
I think that the point where I tripped and discovered the WebDAV support was when enumerating network drives and the possible types were SMB/CIFS, NFS and WebDAV.
Title: Re: Webdav Drive not accessable
Post by: kerdweg on December 13, 2020, 11:57:46 PM
Many thanks for these informations.
Running Winbatch as Invoker=false (WBStudio_IF.exe) solves my problems in the easiest way.