viewpoint-particle

Author Topic: AskDirectory  (Read 42 times)

jmburton2001

  • Newbie
  • *
  • Posts: 15
AskDirectory
« on: May 09, 2018, 07:23:20 am »
EDIT: Found the answer here.

This is a strange one.

Code: [Select]
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

  • Tech Support
  • *****
  • Posts: 2443
    • WinBatch
Re: AskDirectory
« Reply #1 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. 
"Success is a lousy teacher. It seduces smart people into thinking they can't lose."
  - Bill Gates


td

  • Tech Support
  • *****
  • Posts: 2443
    • WinBatch
"Success is a lousy teacher. It seduces smart people into thinking they can't lose."
  - Bill Gates