WinBatch® Technical Support Forum

All Things WinBatch => WinBatch => Topic started by: jmburton2001 on May 09, 2018, 07:23:20 AM

Title: AskDirectory
Post by: jmburton2001 on May 09, 2018, 07:23:20 AM
EDIT: Found the answer here. (http://techsupt.winbatch.com/webcgi/webbatch.exe?techsupt/nftechsupt.web+WinBatch/OLE~COM~ADO~CDO~ADSI~LDAP/Samples~from~Users+Directory~Browse~Dialog~Created~Using~OLE~Shell~Functions.txt)

This is a strange one.

TargetLoc = AskDirectory("Select Backup Directory", "", "","",4)
Message ("Target Directory", TargetLoc)


As an example, I'd like to create the folder "D:\Archive\"

I perform the steps below:
Results:
Explorer -> The directory "D:\Archive\" is created.
Winbatch -> TargetLoc returns "D:\New folder\"

It doesn't matter what drive or directory I choose to create a new folder, the results are always the same. The directory is created but Winbatch returns "New folder".
Title: Re: AskDirectory
Post by: td on May 09, 2018, 08:05:19 AM
This is an old problem that has been known about for a very long time.  The root source is a bug in the Windows Explorer shell introduces many years ago that  Microsoft never fixed in the original shell API. 
Title: Re: AskDirectory
Post by: td on May 09, 2018, 08:28:19 AM
Also as mentioned here:

http://techsupt.winbatch.com/webcgi/webbatch.exe?techsupt/nftechsupt.web+WinBatch/Win7+AskDirectory~in~Windows~7~Ignores~New~Folder.txt (http://techsupt.winbatch.com/webcgi/webbatch.exe?techsupt/nftechsupt.web+WinBatch/Win7+AskDirectory~in~Windows~7~Ignores~New~Folder.txt)