Skip to content

Environment Variables adds invalid Name-Variable pair into registry #46763

@HVB007og

Description

@HVB007og

Microsoft PowerToys version

0.98.1

Installation method

PowerToys auto-update, Microsoft Store

Area(s) with issue?

Environment Variables

Steps to reproduce

Environment Variables allows to add a variable with: (placeholder values)
Name : "test="
Value:"123"

the "=" sign at the end is a invalid character for an environment variable.
on the Next start/restart windows crashed with stopcode: 0xc000021a., i had to open cmd in troubleshoot options and remove the env variable.

Detailed reason when this happened (Un intuitive design) :
0. Environment variables already contain "test=123" Key-Value pair. (i was not aware of this beforehand)

  1. I paste "test=123" into the Name field of add variable of system variables.
  2. I remove "=123" from the value text input box.
  3. The save button greys out without an error saying that key already exists.
  4. I add an "=" sign at the end of the Name for it to become "test=". and "123" as the Value. and click save.
  5. restart pc -> crashes and boot loops.

✔️ Expected Behavior

Shouldnt allow saving invalid key value pairs and add an error or warning when Name matches a key value already in the environment variables list.

❌ Actual Behavior

  1. Environment Variables allows to add a variable with an "=" sign at the end of the Name text input box like following:
    (placeholder values)
    Name : "test="
    Value:"123"

  2. doesn't show an error or warning when just "test" is present in the name field and the save button is greyed out when there is already a Key whose name is "test".

Upload Bug Report ZIP-file

No response

Additional Information

Windows 11 Pro-25H2-26200.8117

Other Software

N/A

Metadata

Metadata

Assignees

Labels

Issue-BugSomething isn't workingNeeds-TriageFor issues raised to be triaged and prioritized by internal Microsoft teamsProduct-Environment VariablesRefers to Environment Variables PowerToys

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions