AskDirectory

Started by jmburton2001, May 09, 2018, 07:23:20 AM

Previous topic - Next topic

jmburton2001

EDIT: Found the answer here.

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:

  • Choose the D drive.
  • Press the "Make New Folder" button.
  • Type in "Archive".
  • Press "Enter" to set the new name.
  • Click the "OK" button to return to the script.
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".

td

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. 
"No one who sees a peregrine falcon fly can ever forget the beauty and thrill of that flight."
  - Dr. Tom Cade

td

"No one who sees a peregrine falcon fly can ever forget the beauty and thrill of that flight."
  - Dr. Tom Cade