Run pdmcli.exe from the command line
Use pdmcli.exe to open PDMShell, run a saved script, or send commands to an existing window. This guide covers the executable's startup options. For the script's target selection and placeholders, see RUNSCRIPT.
Quick start
Find the executable path from your PDMShell shortcut. If pdmcli.exe is on PATH, you can use its name directly:
pdmcli.exe -headless -winlog "C:\Vault\Scripts\Inspect.pdmshell" -items "C:\Vault\Parts\1001.sldprt;C:\Vault\Parts\1002.sldprt"
In this example:
-headless -winlogcontrols the application window and logging.- The
.pdmshellpath identifies the script to run. -itemssupplies the script's targets.
Put startup switches before the script path, and target parameters after it. Quote paths with spaces and quote the entire -items list. Separate targets with semicolons. Connect through your saved automatic vault login, or run an appropriate login command before starting the script (see Control automatic login).
A simple Inspect.pdmshell for file targets is:
fileinfo -filePath "$localPath"
quit -silent
The script must be readable on the executing computer. Supplying its path does not automatically download an uncached script from PDM.
Startup options
These switches do not take a value. The listed dash and slash forms are equivalent and case-insensitive.
| Option | Alternative | What it does |
|---|---|---|
-headless |
/headless |
Opens the smaller shell with fewer editor controls. It can still display dialogs and does not automatically exit. |
-minimized |
/minimized |
Starts the window minimized, with a taskbar entry. Can be combined with -headless. |
-winlog |
/winlog |
Attempts to write command results to the Windows event log under source PDMShell. It does not create a text or CSV report. |
-single |
/single |
Reuses a running single-instance PDMShell window, or starts one if none is available. Forwarding does not wait for the receiving window to finish the script. |
-disableautologin |
/disableautologin |
Prevents saved automatic vault login for this launch. Sign in manually or run login before commands requiring a vault. It does not erase saved login settings. |
-skipautocomplete |
/skipautocomplete |
Skips autocomplete initialization and suggestions for this launch. Useful when suggestions are not needed. |
-autosave |
/autosave |
Automatically saves edits to an existing standalone script file after a short pause. Does not apply to vault scripts or unnamed new scripts. |
-edit |
/edit |
Opens a .pdmshell file in the editor without running it. Use immediately before the script path, after any other startup switches. |
Without -single, launches create separate processes. Without an explicit -headless, the saved Headless setting can still select the smaller shell. These options do not replace vault permissions or command-level license requirements.
Installer and worker switches, such as --offer-vault-addin and --vault-addin-worker, are for PDMShell's own setup processes and are not needed for script automation.
Run or edit a script
A .pdmshell path is converted to a RUNSCRIPT command:
pdmcli.exe "C:\Vault\Scripts\Inspect.pdmshell"
pdmcli.exe "C:\Vault\Scripts\Inspect.pdmshell" -filePath "C:\Vault\Parts\1001.sldprt"
pdmcli.exe "C:\Vault\Scripts\Inspect.pdmshell" -id 123
pdmcli.exe "C:\Vault\Scripts\Inspect.pdmshell" -items "123,45;678,90"
pdmcli.exe "C:\Vault\Scripts\Inspect.pdmshell" -items "C:\Vault\Parts\1001.sldprt;C:\Vault\Parts\1002.sldprt"
pdmcli.exe "C:\Vault\Scripts\Inspect.pdmshell" -search "Name=%.sldprt" -recursive
Choose one target selector: -filePath, -id, -items, or -search. With no selector, the script runs once in the current session context. -items also accepts folder paths mixed with ID pairs; each folder is one target, not a recursive search. Use script commands appropriate to the target types. See items format.
To edit a script and automatically save changes to that existing file:
pdmcli.exe -autosave -edit "C:\Vault\Scripts\Inspect.pdmshell"
Use -edit alone if you prefer to save manually. See Save and open scripts.
Headless mode
pdmcli.exe -headless "C:\Vault\Scripts\Inspect.pdmshell" -items "C:\Vault\Parts\1001.sldprt;C:\Vault\Parts\1002.sldprt"
Headless uses a smaller shell window. It is not a console-only process or a guarantee of unattended operation: login and commands requiring interaction can still display dialogs. End the script with quit -silent to close PDMShell when execution reaches that line.
To also start minimized and skip autocomplete:
pdmcli.exe -headless -minimized -skipautocomplete "C:\Vault\Scripts\Inspect.pdmshell" -filePath "C:\Vault\Parts\1001.sldprt"
quit -silent belongs inside the script. -silent is not an executable startup switch.
Windows event logging
pdmcli.exe -winlog "C:\Vault\Scripts\Inspect.pdmshell" -filePath "C:\Vault\Parts\1001.sldprt"
Open Windows Event Viewer and look for source PDMShell. On first registration, PDMShell attempts to create a custom log named PDMShell. Entries include the user, vault, current directory, error status, and command output. Failed command results are written as Error entries; other results use Information.
The Windows account must be permitted to register the event source and write entries. Logging is best-effort: if registration or writing fails, the command can still run without an event being saved. Check that entries appear under the account used by your automation before relying on them.
For a saved output file, use dump. For per-item operation results, use a supported command's CSV report. -winlog does not redirect output to a file.
Control automatic login
To open PDMShell without using its saved automatic vault login:
pdmcli.exe -disableautologin
To choose a vault explicitly before running a script, pass the login and script commands as separate quoted arguments:
pdmcli.exe -disableautologin "login -auto -vaultName Engineering" "runscript -source C:\Vault\Scripts\Inspect.pdmshell -filePath C:\Vault\Parts\1001.sldprt"
Replace the vault name and paths with your own. This short example uses paths without spaces; see Quotes and paths for nested quoting. Connect before calling runscript: reading a script and resolving its targets require a connected vault. -auto is a login parameter, not an executable startup switch.
Wait for completion
Use a separate process when the calling program needs the script's result. End the script with quit -silent.
The standalone process returns 0 for success or 1 if a command/script failed or was canceled. Later successful commands do not clear an earlier failure. The exit code becomes available only when PDMShell closes. If execution stops before reaching quit, it can remain open.
PowerShell
A quoted executable path needs PowerShell's & call operator for a direct launch:
& "C:\Path\To\pdmcli.exe" -headless "C:\Vault\Scripts\Inspect.pdmshell" -filePath "C:\Vault\Parts\1001.sldprt"
To explicitly wait and read the process exit code:
$process = Start-Process -FilePath "C:\Path\To\pdmcli.exe" -ArgumentList '-headless -winlog "C:\Vault\Scripts\Inspect.pdmshell" -items "C:\Vault\Parts\1001.sldprt;C:\Vault\Parts\1002.sldprt"' -Wait -PassThru
$process.ExitCode
Replace the executable and vault paths with your own. Do not use -single with this pattern.
Command Prompt or a batch file
start "" /wait "C:\Path\To\pdmcli.exe" -headless "C:\Vault\Scripts\Inspect.pdmshell" -filePath "C:\Vault\Parts\1001.sldprt"
echo %ERRORLEVEL%
The empty "" is the window-title argument required by start before a quoted executable path. Read %ERRORLEVEL% immediately after completion.
Reuse one window
Start the receiving instance with the options it should use:
pdmcli.exe -single -winlog
Then send a command to that instance:
pdmcli.exe -single "runscript -source C:\Vault\Scripts\Inspect.pdmshell -id 123"
Use paths without spaces in this short example, or follow Quotes and paths for nested quoting. Do not end a script with quit if you want the receiving window to stay open.
Use the same Windows account, Windows session, and elevation level. Separate Remote Desktop sessions use their own PDMShell window. You can open multiple tabs without starting another listener. Startup options on a later forwarding process do not reconfigure the already-running window; enable options such as -winlog when starting the receiving instance.
The forwarding process waits briefly if the receiving window is still starting. It exits with an error if it cannot send the request. After successful delivery, its exit code does not report the receiving script's outcome, and it does not return that window's command output. Avoid -single when automation must wait for the script or inspect its exit code. Put dependent operations in one script.