browsefolder
Choose one existing folder without changing it or the current PDMShell directory. See File and folder pickers for variable lifetime, cancellation, and supported hosts.
Syntax
browsefolder -variable Name [-title "Title"] [-directory "Starting folder"] [-global]
Parameters
| Parameter | Alias | Required | Description |
|---|---|---|---|
-variable |
-var |
Yes | Result name; read ${local.Name}, or ${global.Name} with -global. |
-title |
No | Dialog title; supports placeholders. | |
-directory |
-d |
No | Existing starting folder; supports placeholders and relative paths. |
-global |
No | Store in the current session instead of the current script. Required for command-box use. |
Example
browsefolder -variable Destination -title "Choose destination"
msgbox -value "Selected: ${local.Destination}"
For command-box use or reuse across scripts:
browsefolder -variable Destination -global
msgbox -value "Selected: ${global.Destination}"
Cancel clears the result and stops the script without a command error. Unattended tasks and MCP cannot open this dialog. For file selection use browsefile.