US$0.00
0

How to Log Into SOLIDWORKS PDM Automatically at Windows Startup With PDMShell

Log a SOLIDWORKS PDM task host back into the vault after every restart with a two-line PDMShell script and the built-in Windows startup script setting in PDMShell 4.1.57 and newer.
PDMShell Windows startup script dialog with script path, start headless, start minimized and quit after the script runs
Picture of Amen Jlili

Amen Jlili

Amen Jlili is the founder and technical director of Blue Byte Systems Inc., a software company in Vancouver, Canada, specializing in automating SOLIDWORKS and PDM.

To log into SOLIDWORKS PDM automatically every time Windows starts, write a two-line PDMShell script that logs the vault in through File Explorer with a saved Windows credential, then point PDMShell’s built-in Windows startup script setting at it. No Task Scheduler and no batch files. It is ideal for a PDM task host that restarts after Windows updates and has to log back into the vault on its own.

This feature needs PDMShell 4.1.57 or newer. On an older version, use the Task Scheduler method instead, or update first.

Why the task host matters

A PDM task host only picks up tasks while the vault is logged in on that machine. When Windows installs updates overnight and restarts it, Windows comes back but the vault does not. Approved drawings produce no PDFs, conversions sit at Waiting, and nobody notices until someone remotes in and logs into the vault by hand.

With a startup script, the task host logs itself back in as soon as Windows signs in, before the first engineer approves anything.

Step 1: Check your PDMShell version

Open PDMShell, go to Settings, then About PDMShell, or type version in the console. You need 4.1.57 or newer. If you are on an older build, download the latest version from bluebyte.biz and install it on the task host.

Step 2: Save the PDM login in Windows Credential Manager

Sign into the task host with the Windows account it runs under, and save the PDM user and password once as a generic credential. In a Command Prompt:

cmdkey /generic:pdmshell /user:admin /pass

Windows asks for the password and stores it for that Windows account only. You can also add it in Control Panel, under User Accounts, Credential Manager, Windows Credentials, Add a generic credential. Use the PDM user the task host normally logs in with.

Windows Credential Manager showing a generic credential named pdmshell
The saved PDM credential, named pdmshell, under Generic Credentials.

Step 3: Build the login script

Open the PDMShell visual editor and add two actions after Begin:

  • Log into vault (the login command). Tick explorer, enter the credential name in credentials, and pick your vault in vaultName. Leave username and password empty.
  • Exit PDMShell (the quit command).
PDMShell visual editor with a login node set to explorer, credentials and vault name
The login action with explorer ticked, the saved credential and the vault name.

Switch to the code view and the whole script is two lines:

login -explorer -credentials "PDMShell" -vaultName "sandbox"
quit -silent

Replace sandbox with your vault name. The -explorer option logs the vault in through its File Explorer Log In command, the same login a user does by hand, so the PDM client on that machine is logged in and the task host can pick up tasks. The credentials value must match the name you saved in Credential Manager. Save the script, for example as C:\Scripts\AutoLoginWithWindowsCredentialsOnStartup.pdmshell.

Step 4: Start PDMShell when Windows starts

In PDMShell, open Settings, go to General, and under Startup tick Start application when Windows starts.

PDMShell Settings, General tab, with Start application when Windows starts and the Startup script button
Settings, General: turn on Start application when Windows starts, then open Startup script.

Step 5: Choose the startup script

Next to that setting, select Startup script. In the Windows startup script dialog:

  1. Script path: browse to the script you saved in Step 3.
  2. Start headless (hide the window): tick this on a task host so nothing appears on screen.
  3. Start minimized: an alternative if you would rather keep a taskbar entry.
  4. Quit after the script runs: tick this so PDMShell closes once the login is done.

Select Save.

PDMShell Windows startup script dialog with script path, start headless, start minimized and quit after the script runs
The Windows startup script dialog. Tick Start headless and Quit after the script runs for a task host.

Step 6: Test it

Sign out of Windows and back in, or restart the task host. When the desktop comes up, PDMShell runs the script in the background and the vault is logged in. Open File Explorer to check the vault, or queue a test task and watch it run.

Make sure Windows signs in on its own

The startup script runs when the task host’s account signs into Windows. Most task hosts already sign in automatically because SOLIDWORKS-based tasks need a desktop session. If yours stops at the sign-in screen after a restart, turn on automatic sign-in for that account, for example with Microsoft’s free Sysinternals Autologon tool, and follow your IT policy.

FAQ

Is the PDM password stored in the script?

No. The script only holds the credential name. The user name and password stay in Windows Credential Manager, for that Windows account only.

What if the PDM server was still restarting when the task host signed in?

The login fails and the vault stays logged out. Remote in and run the script again from PDMShell, or sign out and back in. If your PDM servers and task host restart in the same window, schedule the task host to restart a little later.

What if the PDM password changes?

Update the pdmshell entry in Credential Manager, or run the same cmdkey command again under the task host’s account. The script does not change. A changed PDM password is a common reason a task host stops processing tasks.

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.

Does this work on engineering PCs too?

Yes. Set it up under each user’s Windows account, with their own saved credential, and their vault is logged in when they sign in. Leave Start headless off if you want them to see the vault window open.

Do I need PDMShell Premium?

No. The login command is available in the free version of PDMShell. You only need version 4.1.57 or newer for the Windows startup script setting.

Try it

Download PDMShell or start a free PDMShell trial. The full command reference is in the PDMShell documentation. Need help setting up your task hosts? Open a ticket with Blue Byte Systems support.

Need this adapted to your workflow?

We build custom SOLIDWORKS macros, add-ins and PDM automation.

Picture of Amen Jlili

Amen Jlili

Amen Jlili is the founder and technical director of Blue Byte Systems Inc., a software company in Vancouver, Canada, specializing in automating SOLIDWORKS and PDM.
0
0
Your Cart
Your cart is emptyReturn to Shop