To switch users in Windows 10 from the command prompt, you cannot directly launch the switch-user screen with a single built-in command like `switchuser`, but you can trigger the Lock screen (which shows all active and saved user accounts) or invoke the secure attention sequence to display the sign-in screen. This method is useful for remote administration, unattended sessions, or scripted tasks. You’ll need a Command Prompt or PowerShell window running with standard or elevated privileges—no extra tools are required, though having at least one other user account configured on the PC is essential.

What You'll Need

  • A Windows 10 device (versions 1607 through 22H2 supported; behavior is consistent across modern updates)
  • A Command Prompt or PowerShell window (run as your current user; admin rights are optional but helpful for some methods)
  • At least one additional user account (local or Microsoft) set up on the PC, with a password if required by group policy
  • Knowledge of the target user’s credentials (username and password); you’ll enter them interactively during the sign-in process

Step-by-Step

  1. Open Command Prompt: Press Win + R to open the Run dialog, type cmd, and press Enter. Alternatively, right-click the Start button and select Command Prompt or Windows Terminal (Admin) if you prefer admin privileges.
  2. Lock the current session to show the sign-in screen with all available users: Type tscon 0 /dest:console and press Enter. This redirects the current session’s console to the physical desktop, effectively locking it and displaying the login screen. If you see an error like "The system cannot find the file specified" or "Invalid parameter", skip to Method 2 below.
  3. If Method 1 fails (common on newer Windows 10 versions due to security restrictions), use the Windows API call via PowerShell instead: Type powershell -Command "Add-Type -AssemblyName System.Windows.Forms; [System.Windows.Forms.Application]::LockWorkStation()" and press Enter. This invokes the same secure attention sequence as pressing Win + L, instantly locking your session and showing the user selection screen.
  4. Wait a moment—the screen will lock, and the Windows sign-in interface appears. You’ll see a list of user accounts configured on the PC, including those with cached credentials.
  5. Select the desired user account from the list. If it’s not visible, click Other user to manually enter the username (e.g., COMPUTERNAME\username or username@domain.com).
  6. Enter the target user’s password (or PIN if configured) and press Enter. The system switches to that user’s desktop session.

Common Mistakes

  • Using outdated commands like quser or wtsapi32.dll calls—these list sessions but do not switch users. The runas command launches a new process under another account but does not log in the user or switch the active desktop session.
  • Running tscon without specifying /dest:console—the command will fail because it lacks the required destination parameter. Always include /dest:console explicitly.
  • Assuming switchuser is a native command—it isn’t. Third-party tools sometimes provide it, but they are unnecessary and potentially risky.
  • Attempting to switch without a password-protected account—Windows blocks switching to accounts without passwords for security reasons. Ensure the target user has a strong password set.
  • Expecting silent background switching—the command prompt locks the current session; you cannot switch users invisibly while preserving the current user’s open apps. This is intentional for security.

Tips

  • For remote administration via RDP, use Task Manager instead: Press Ctrl + Shift + Esc, click More details, go to the Users tab, right-click the target user, and choose Connect. This avoids locking your own session.
  • Save the PowerShell lock command as a script (e.g., switch-user.ps1) with content [System.Windows.Forms.Application]::LockWorkStation() for quick reuse. Run it from any Command Prompt using powershell -f "C:\path\switch-user.ps1".
  • Ensure Fast User Switching is enabled: Go to Control Panel > User Accounts > Change user account control settings, then Advanced options under Sign-in options, and verify Require sign-in isn’t set to Immediately (which hides other users).
  • Use whoami in Command Prompt to confirm your current username before locking—helpful if managing multiple accounts.
  • On domain-joined PCs, group policies may restrict switching. If users don’t appear, contact your IT admin to verify Interactive logon: Do not require CTRL+ALT+DEL and Interactive logon: Number of previous logons to cache policies are permissive.

Troubleshooting

  • Error: "Access Denied" when running tscon—This occurs because non-admin users lack permission to redirect console sessions. Use Method 2 (PowerShell lock) instead, which requires no special privileges.
  • No other users appear on the sign-in screen—Check if Fast User Switching is disabled. Navigate to Settings > Accounts > Sign-in options, scroll to Privacy, and ensure Show account selection screen on sign-in is On. If disabled, enable it and restart.
  • Session locks but reverts immediately—Some antivirus or endpoint protection tools intercept lock commands. Temporarily disable real-time protection (via Windows Security settings), retry, then re-enable it.
  • PowerShell command fails with "Cannot find type"—This happens on minimal Windows installations (e.g., Server Core). Use rundll32.exe user32.dll,LockWorkStation instead—type it directly in Command Prompt and press Enter.
  • Switched user has a blank desktop or missing apps—The new user may have a corrupted profile. Log in as an administrator, go to Settings > Accounts > Family & other users, select the user, and choose Change account type to verify it’s active. If issues persist, delete and recreate the profile.

Frequently Asked Questions

Can I switch users without entering a password?

No—Windows 10 requires a password or PIN for all non-administrative user switches. Auto-login (storing credentials in Registry) is unsupported for security and breaks the switch-user flow. If the account has no password, Windows blocks switching to it entirely.

Does this work on Windows 11?

The PowerShell and rundll32 methods work identically on Windows 11. The tscon approach is less reliable due to stricter session isolation in newer builds, so prefer the lock command.

Can I automate switching between users via script?

Not silently—the lock command always interrupts the session. You could chain a script to run LockWorkStation() followed by a Start-Sleep -Seconds 5 and Start-Process "explorer.exe" under another context, but the user interaction (password entry) remains manual. Fully automated switching isn’t supported for security.

Why does the switch sometimes show my account again?

Windows caches your login session briefly after locking. If you switch too quickly (e.g., within 2–3 seconds), the system may not finalize the lock. Wait until the sign-in screen fully renders before selecting another user.

Is there a keyboard shortcut from Command Prompt?

Yes—press Win + L after opening Command Prompt. It locks the workstation identically to the PowerShell method but requires physical keyboard access. This is the fastest manual option if you’re at the machine.

What if the target user is already logged in elsewhere?

Windows 10 allows only one active session per user at a time. If the user is logged in on another console (e.g., local or RDP), switching to them will disconnect their existing session. Confirm their status first using quser in Command Prompt (elevated) to list active sessions.