How-to
How to Manage WinCC Runtime User Accounts and Password Changes
Short answer
Open the WinCC User Administrator at runtime by launching PassCS.exe from a button with a ProgramExecute C action, using the full installed path C:\Program Files\Siemens\WinCC\bin\PassCS.exe. Gate the button with an authorization, and keep operator login, own-password change, and account administration as three separately tested operations. Comfort and Advanced panels are administered in the engineering tool instead.
On this page
You already have runtime login and logout buttons; the missing piece is account administration while the runtime is live. WinCC ships that interface: the User Administrator program, PassCS.exe, in the WinCC bin folder. One button with a ProgramExecute C action opens it, the button's authorization decides who may open it, and inside it the logged-in account changes its own password while an account with administration rights creates users. Keep three operations separate: logging in, changing your own password, and administering accounts. This route is documented on WinCC 7.0 PC runtime; Comfort, Advanced and Basic Panels administer users in the engineering tool instead.
Open the User Administrator from a runtime button #
- Confirm the executable on the runtime PC:
C:\Program Files\Siemens\WinCC\bin\PassCS.exe. If WinCC is installed somewhere else, use the bin folder of that installation. - Place a button on an administration picture, not on the main operator screens.
- Add a C action to the button's click event; the editor writes the
OnClickfunction header for you. - Enter the action below, keeping the full path: Windows must resolve the executable from the runtime's launch context, and a bare
PassCS.exeis not guaranteed to resolve. - Set the button's authorization to a level every account holds, so the effective gate is being logged in, and the logged-out state is refused.
- Save and reactivate the project, then run the acceptance matrix below before anyone depends on the button.
#include "apdefap.h"
void OnClick(char* lpszPictureName, char* lpszObjectName, char* lpszPropertyName)
{
unsigned long int ulResult = 0;
ulResult = ProgramExecute("C:\\Program Files\\Siemens\\WinCC\\bin\\PassCS.exe");
}
ProgramExecute, OnClick, apdefap.h and the path are the documented items; ulResult is an illustrative variable of mine, declared and initialized because ProgramExecute returns an unsigned long int. No available source documents what the return values mean, so prove the button with the matrix, not with the return code.
What changes inside the User Administrator #
PassCS.exe is the runtime face of the account system your login buttons already use. The logged-in account changes its own password there; an account with administration rights creates users, assigns group membership and resets other people's passwords. Group membership carries the authorizations that decide what an account can do on every screen, so copying an administrator's settings just to make a login succeed is wrong practice — give the account the group its job needs. Structuring those groups for operators and maintenance is its own design task, covered in designing HMI user access levels for operators and maintenance.
Keep login, self-service and administration separate #
Login and logout only start and end the runtime session; they create nothing and change no passwords. When the control program also needs to know which operator is active, that is a separate job — sending the active HMI user to the PLC with login macros is the pattern. Three operations, three owners:
| Operation | Owner | Where it happens |
|---|---|---|
| Login and logout | Any account holder | Your existing runtime buttons |
| Change own password | The logged-in account | User Administrator |
| Create accounts, assign groups, reset others | User administrator | User Administrator, behind its own rights |
An account that can administer users can grant itself every authorization on the machine, so administrator credentials go to named maintainers, never to a shared shift login.
The acceptance matrix that proves the boundary #
Run this on the machine with one operator test account and one administrator test account before anyone relies on the button. Three session states crossed with four operations gives 3 × 4 = 12 checks. The expected split is 6 allowed and 6 denied: the logged-out row allows 0, the operator row allows 2, the administrator row allows 4, and 0 + 2 + 4 = 6 with 12 − 6 = 6 refusals.
| Session state | Open the button | Change own password | Create an account | Edit another account |
|---|---|---|---|---|
| Logged out | Deny | Deny | Deny | Deny |
| Operator test account | Allow | Allow | Deny | Deny |
| Administrator test account | Allow | Allow | Allow | Allow |
What the User Administrator lets a non-administrator do inside its window is an authorization question, and the matrix answers it for the installed version. Any cell that behaves otherwise is a finding, and the decision after a finding is fixed: raise the button's authorization to the administrator level only, and route operator password changes through maintenance, because a launch button you cannot bound is not a boundary.
Comfort, Advanced and Basic Panels follow a different route #
The ProgramExecute C action belongs to WinCC PC runtime, documented on WinCC 7.0, where the runtime is a Windows program on a computer you administer. Comfort and Advanced projects define users, groups and authorizations in the engineering software before download, and Basic Panels expose their runtime password settings through the Runtime settings > User administration editor. The decision follows the product: on a panel runtime, configure users in the engineering project, because the button-and-executable method does not apply there.
When the button does nothing #
- The path does not resolve. Use the full installed path, with each backslash doubled in the C string; a bare
PassCS.exedepends on the launch environment. - The file is missing. Confirm
PassCS.exein the WinCC bin folder on the runtime PC, not only on the engineering station. - The Windows identity is the limit.
ProgramExecuteruns under the Windows account of the runtime PC, and the WinCC login does not elevate it; if behavior changed after a Windows account change, why WinCC 7.5 runtime fails under a new Windows user isolates that side. - The project was not reactivated. Save and reactivate so the compiled action is what runs.
Making the Windows account a local administrator to force the launch trades a configured gate for an open operating system; fix the authorization instead.
Questions asked
Does ProgramExecute need the full path to PassCS.exe?
Use the documented full path C:\Program Files\Siemens\WinCC\bin\PassCS.exe. A bare file name only works when the launch environment happens to resolve it, and a runtime button gives no such guarantee. If WinCC is installed in a different folder, take the bin folder path from that installation, and write each backslash doubled in the C string so the compiler sees one.
Can an operator change their own password without the User Administrator?
Not with the login and logout buttons alone; they only start and end the runtime session. On WinCC PC runtime, the User Administrator is where the logged-in account changes its own password, which is why the launch button exists at all. If your policy keeps that button at administrator-only, operators get password resets from maintenance instead of self-service.
Does the ProgramExecute method work on Comfort, Advanced or Basic Panels?
No. On those panels, user configuration lives in the engineering side of the project, not in a runtime-launched Windows program. Launching an executable from a C action is a WinCC PC runtime mechanism, documented on WinCC 7.0, and it does not apply to panel runtimes.
An operator forgot their password. Where is the reset?
In the User Administrator, signed in with an account that has administration rights: select the operator's account and set a new password. When no administrator account is reachable at all, use the vendor's documented recovery procedure for the installation. Reading or editing the protected account storage directly is not a supported reset, whatever the lockout pressure.
Should the C action check the value ProgramExecute returns?
The function is declared to return an unsigned long int, so capture it into a variable of that type if you want it in a log. The documented sources do not state which values mean success or failure, so branching on it would be guessing. Prove the action the direct way: the User Administrator window opens under the accounts that should open it and stays closed otherwise.