Skip to content

Bug: Batch files are executed as SYSTEM user #12139

Closed
@Cromagnon31

Description

@Cromagnon31

Description

When double clicking on a batch file or an executable, it's executed as SYSTEM user.

USERNAME=SYSTEM
USERPROFILE=C:\Users\OW

When you open a shell on a directory is is executed as the session user.

USERNAME=OW
USERPROFILE=C:\Users\OW

USERPROFILE is good but not USERNAME !

Steps To Reproduce

  1. log in Windows session as standard user (eg not SYSTEM user) and open Files.

1 Edit a batch files with the 2 lines :
SET
PAUSE
Open(double click) the batch file.
Look at USERNAME variable, it's SYSTEM
or

2 Open(double click) %windir%\system32\cmd.exe and run set command in the newly opened shell.
Look at USERNAME variable, it's SYSTEM

  1. Open a shell and run the batch file or set command
    Look at USERNAME it it's the logged user name.

Requirements

When opening a batch file or an executable it should run in the user environmement eg environment, variable USERNAME should be equal to the logged user name, not SYSTEM.

Files Version

2.4.62.0

Windows Version

Window 11 pro 22H2 22261.1555

Log file

debug.log

Metadata

Metadata

Assignees

No one assigned

    Labels

    help wantedExtra attention is needed

    Type

    No type

    Projects

    Status

    ✅ Done

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions