# How to Run Win11Debloat for Other Users: CLI and GUI Methods

> Learn how to run Win11Debloat for other users using CLI or GUI methods. Effortlessly target specific local accounts and clean up their profiles with Win11Debloat.

- Repository: [Jeffrey/Win11Debloat](https://github.com/Raphire/Win11Debloat)
- Tags: how-to-guide
- Published: 2026-03-10

---

**Win11Debloat supports targeting different local user accounts via the `-User` parameter in CLI mode or the "Other User" selection in the GUI, automatically resolving profile paths through the `GetUserDirectory` function.**

The Win11Debloat script from the Raphire/Win11Debloat repository is designed to clean and customize Windows 11 installations. While it defaults to the currently logged-on account, you can run Win11Debloat for other users by leveraging built-in switches that redirect all registry modifications, app removals, and Start Menu changes to a specific target profile.

## Using the Command-Line Interface (CLI)

The most direct method to run Win11Debloat for other users is passing the `-User` switch when invoking the main script. In `Win11Debloat.ps1`, the `GetUserName` function (lines 367-373) checks for this parameter and overrides the default `$env:USERNAME` value.

When supplied, the script resolves the target profile path via `GetUserDirectory` (lines 377-410), ensuring that all user-specific actions—such as registry imports, Start Menu replacements, and application removals—operate on the correct directory structure.

To debloat another account from the command line:

```powershell

# Remove default apps for user "jdoe"

.\Win11Debloat.ps1 -User jdoe -RemoveApps

# Apply full defaults plus telemetry disable for another user

.\Win11Debloat.ps1 -User jdoe -RunDefaults -RemoveApps -DisableTelemetry

# Replace Start Menu layout for a specific user only

.\Win11Debloat.ps1 -User jdoe -ReplaceStart "C:\MyStartMenu\start2.bin"

```

## Using the Graphical User Interface (GUI)

For those preferring a visual workflow, the GUI provides a **User Selection** combo-box that supports targeting accounts interactively. Located in `Scripts/GUI/Show-MainWindow.ps1` (lines 24-46), this interface element offers an **"Other User"** option that reveals a text input panel.

The validation logic resides in `Win11Debloat.ps1` within the `CheckIfUserExists` function (lines 415-428), which verifies the entered username against local accounts before proceeding.

To use the GUI method:

1. Launch the script by double-clicking `Run.bat` or running `.\Win11Debloat.ps1` without parameters.
2. Click the **User Selection** drop-down in the top-right and select **Other User**.
3. Enter the target username (e.g., `jdoe`) in the panel that appears. A green "User found" confirmation indicates successful validation.
4. Select your desired debloat options and click **Apply** to execute changes against the specified profile.

## How User Targeting Works Under the Hood

Both CLI and GUI methods feed into the same backend architecture. The chosen username is stored in `$script:Params["User"]`, which centralizes the active user identity for the entire execution context.

When `-User` is specified, `GetUserName` returns the provided value instead of the current session's username. Consequently, all feature modules—whether removing bloatware, importing registry files, or replacing Start Menu binaries—automatically resolve paths through `GetUserDirectory` to target the specified user's `%USERPROFILE%` instead of the administrator's.

This design is independent of **Sysprep mode** (`-Sysprep`), which targets the *Default* user template for new account provisioning. The `-User` switch specifically operates against existing local accounts and is safe for any profile not currently in active use.

## Practical Examples for Common Scenarios

**Full System Debloat for Another Account**

Execute a comprehensive cleanup on a colleague's or family member's profile while logged in as administrator:

```powershell
.\Win11Debloat.ps1 -User jdoe -RunDefaults -RemoveApps -DisableTelemetry -DisableOnedrive

```

**Isolated Start Menu Customization**

Deploy a standardized Start Menu layout to a specific user without affecting other profiles:

```powershell
.\Win11Debloat.ps1 -User jdoe -ReplaceStart "C:\CompanyTemplates\standard_start.bin"

```

**Registry-Only Modifications**

Apply privacy-focused registry tweaks to another user's hive:

```powershell
.\Win11Debloat.ps1 -User jdoe -DisableTelemetry -DisableSuggestions

```

## Summary

- **CLI Method**: Append `-User <username>` to any `Win11Debloat.ps1` invocation; the `GetUserName` and `GetUserDirectory` functions in `Win11Debloat.ps1` handle path resolution automatically.
- **GUI Method**: Select **Other User** from the **User Selection** combo-box in `Show-MainWindow.ps1`, validated by `CheckIfUserExists`.
- Both interfaces populate `$script:Params["User"]`, ensuring consistent behavior across app removal, registry edits, and Start Menu replacement.
- The `-User` parameter targets existing local accounts and functions independently from `-Sysprep` mode.

## Frequently Asked Questions

### Can I run Win11Debloat for a user that is currently logged off?

Yes. The script resolves the user profile path through `GetUserDirectory` based on the local account database and registry hive locations, not the active session state. As long as the user profile exists on the system, Win11Debloat can modify it regardless of login status.

### Does the -User parameter work with Sysprep mode?

No. The `-Sysprep` switch targets the *Default* user template specifically designed for imaging and new account creation. The `-User` parameter is intended for existing local accounts and operates independently from Sysprep mode according to the source code implementation.

### What happens if I enter a non-existent username in the GUI?

The `CheckIfUserExists` function (lines 415-428 in `Win11Debloat.ps1`) validates the input against local accounts. If the username does not exist, the GUI displays a validation error and prevents execution until a valid local username is provided.

### Are administrator privileges required when targeting other users?

Yes. Modifying another user's registry hive and profile directory requires elevated privileges. Run PowerShell or `Run.bat` as Administrator before executing Win11Debloat with the `-User` switch to ensure proper access to the target profile's `%USERPROFILE%` and `NTUSER.DAT`.