To get a SOLIDWORKS PDM task host machine logged back into the vault automatically after it restarts, save the PDM password once in Windows Credential Manager, put one PDMShell line in a script, login -explorer -vaultName "Production" -credentials "pdmshell", and run that script with pdmcli.exe every time Windows signs in. The vault is logged in again before anyone notices, and no password is stored in the script.
This post is part of our PDMShell guide.
The Tuesday morning problem
Picture a company whose PDM tasks run on a dedicated task host: a PC in the server room that converts released drawings to PDF and STEP with PDMPublisher, runs PDMShell scripts on workflow transitions, and handles anything else the vault queues up. Nobody sits at it. It just has to be logged into the vault, because a PDM task host only picks up tasks while the vault is logged in on that machine.
Overnight on Patch Tuesday, Windows installs updates and restarts the task host. Windows comes back up, but the vault is not logged in. All morning, engineers approve drawings and nothing comes out. The PDFs never land in the release folder, the shop floor waits, and the task list fills up with tasks stuck at Waiting. Around eleven, someone remembers the task host, remotes in, opens File Explorer and logs into the vault by hand. Then everything that queued since the night before runs at once.
What the PDM admin wants is simple: when the task host restarts for any reason, it logs back into the vault on its own, as the right PDM user, without anyone remoting in.
The login command
The PDMShell login command has an -explorer option made for this. It uses the vault’s own File Explorer log in, the same one a user would do by hand, and then opens a new Explorer window on the vault.
login -explorer -vaultName "Production" -credentials "pdmshell"
-explorerlogs in through File Explorer and opens a vault window.-vaultNameis the name of the local vault view.-credentialsis the name of a saved Windows credential that holds the PDM username and password.
With -explorer you must give either -credentials or -username and -password. Use -credentials, so the password never sits in a file.
Step 1: Save the PDM password in Windows Credential Manager
Sign into the task host with the Windows account it runs under, and run this once in a Command Prompt. Windows asks for the password and stores it for that Windows account only:
cmdkey /generic:pdmshell /user:jsmith /pass
You can also add it by hand in Control Panel, under User Accounts, Credential Manager, Windows Credentials, Add a generic credential. Either way, it shows up under Generic Credentials. The name, here pdmshell, must match the -credentials value in the script exactly.

Because the credential belongs to one Windows account, save it while signed in as the task host’s account, not as your own admin account. Use the PDM user the task host normally logs in with.
Step 2: Write the script
Create a plain text file called pdm-login.pdmshell, for example in C:\Scripts:
# Log into the Production vault through File Explorer
login -explorer -vaultName "Production" -credentials "pdmshell"
# Save what happened to a dated log file
dump -filePath "$tempFolder\pdm-login_$yyyy-$mm-$dd_$HH-$mi-$ss.txt"
# Close PDMShell
quit -silent
dump writes everything PDMShell printed to a log file in the Windows temporary folder of the account running the script, named with the date and time, for example pdm-login_2026-11-10_03-01-12.txt. When the task host has restarted overnight, that file tells you whether the login worked. In the name, $mm is the month and $mi is the minutes. $tempFolder is that account’s Windows temporary folder, usually C:\Users\<account>\AppData\Local\Temp. To open it, press Windows+R and type %TEMP%.
quit -silent closes PDMShell when the script is done, so nothing is left open on the task host’s screen.
Step 3: Run it from the command line
PDMShell installs for the current Windows user, so pdmcli.exe is in that user’s profile, not in Program Files. Put the startup switches first and the script path last:
"%LOCALAPPDATA%\Blue Byte Systems\PDMShell\current\pdmcli.exe" -headless -minimized "C:\Scripts\pdm-login.pdmshell"
The current folder always points at the installed version, so this path stays the same after PDMShell updates.
-headlessopens PDMShell’s smaller shell instead of the full editor.-minimizedstarts that window minimized to the taskbar, so nothing pops up on the task host’s screen.
Neither switch closes PDMShell on its own, which is why the script ends with quit -silent. Run the command once by hand to check that the vault logs in.
Step 4: Make Windows sign in on its own after a restart
A script that runs at sign-in only helps if Windows actually signs in. Most task hosts already sign in automatically, because SOLIDWORKS-based tasks need a desktop session. If yours stops at the Windows sign-in screen after a restart, turn on automatic sign-in for the task host’s account. The simplest way is Microsoft’s free Sysinternals Autologon tool, which stores the Windows password encrypted rather than in plain text. Follow your IT policy here, and keep the task host in a locked room or on a restricted network.
Step 5: Run the script every time Windows starts
Use Windows Task Scheduler on the task host. It runs the script at sign-in and can wait a little first, which matters after updates, when the PDM archive and database servers may be restarting too.
- Open Task Scheduler and select Create Task (not Create Basic Task).
- On the General tab, name it PDM Login, choose the task host’s Windows account, and leave “Run only when user is logged on” selected. The Explorer login needs that account’s desktop.
- On the Triggers tab, select New, set “Begin the task” to At log on for that account, tick “Delay task for” and pick 1 minute. Use more if your PDM servers take longer to come back after updates.
- On the Actions tab, select New, choose Start a program, and enter
"%LOCALAPPDATA%\Blue Byte Systems\PDMShell\current\pdmcli.exe"as the program and-headless -minimized "C:\Scripts\pdm-login.pdmshell"as the arguments. - Select OK. To test it, right-click PDM Login and choose Run, or restart the task host and watch it log back in.
Prefer no Task Scheduler? Sign in as the task host’s account, press Windows+R, type shell:startup, and create a shortcut in that folder with the same command line from Step 3. It runs at sign-in, just without the delay.
Back to Tuesday morning
The admin copies pdm-login.pdmshell to C:\Scripts on the task host, saves the PDM credential once under the task host’s account, and adds the PDM Login task. The next Patch Tuesday, the task host restarts at 3 a.m., signs into Windows, waits a minute and logs back into the vault. By the time engineers start approving drawings, the PDFs are already flowing, and nobody has to remember the machine in the server room.
The same script works on engineering PCs too. Set it up under each user’s Windows account and their vault is logged in and open in File Explorer when they sign in.
FAQ
Is the password stored in the script?
No. With -credentials the script only holds the credential name. The username and password stay in Windows Credential Manager for that Windows account.
Can I log into more than one vault?
Yes. Add one login -explorer line per vault before quit -silent, each with its own vault name and credential.
What if the PDM servers were still restarting when the task host signed in?
The login fails, the vault stays logged out, and the log file in the temporary folder shows the error. Increase the delay on the trigger so the archive and database servers are back first. To recover without a restart, remote in and run the PDM Login task from Task Scheduler.
What if the PDM password changes?
Run the same cmdkey command again under the task host’s account, or edit the pdmshell entry in Credential Manager. The script does not change. A PDM password change is a common reason a task host suddenly stops processing tasks, so update the credential at the same time.
Does this need PDMShell Premium?
No. The login command is available in the free version of PDMShell.
Try it
Download PDMShell or start a free PDMShell trial. The full command reference is in the PDMShell documentation. Need help rolling this out across your team? Open a ticket with Blue Byte Systems support.