Home

Server 2019 %username%

%3CLINGO-SUB%20id%3D%22lingo-sub-238579%22%20slang%3D%22en-US%22%3EServer%202019%20%25username%25%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-238579%22%20slang%3D%22en-US%22%3E%3CP%3ERunning%20Server%202019%20I've%20noticed%20that%20the%20%25username%25%20variable%20is%20now%20set%20to%20SYSTEM.%26nbsp%3B%20With%20Server%202016%2C%20when%20a%20user%20runs%20a%20batch%20file%20I%20can%20use%20the%20%25username%25%20variable%20to%20return%20the%20name%20of%20the%20user%20running%20the%20session.%26nbsp%3B%20However%2C%20with%20Server%202019%2C%20when%20a%20user%20runs%20a%20batch%2C%20the%20%25username%25%20variable%20returns%20as%20SYSTEM.%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EI'm%20getting%20around%20this%20by%20parsing%20%25userprofile%25%20to%20find%20the%20name.%26nbsp%3B%20Should%20we%20expect%20this%20to%20be%20a%20change%20in%20how%20Server%202019%20operates%3F%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EI%20should%20note%20that%20I%20am%20running%20build%2017723.%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-LABS%20id%3D%22lingo-labs-238579%22%20slang%3D%22en-US%22%3E%3CLINGO-LABEL%3EServer%202019%3C%2FLINGO-LABEL%3E%3CLINGO-LABEL%3EWindows%202019%3C%2FLINGO-LABEL%3E%3C%2FLINGO-LABS%3E
Steven Biggs
Frequent Visitor

Running Server 2019 I've noticed that the %username% variable is now set to SYSTEM.  With Server 2016, when a user runs a batch file I can use the %username% variable to return the name of the user running the session.  However, with Server 2019, when a user runs a batch, the %username% variable returns as SYSTEM.

 

I'm getting around this by parsing %userprofile% to find the name.  Should we expect this to be a change in how Server 2019 operates?

 

I should note that I am running build 17723.

 

Related Conversations
Tabs and Dark Mode
cjc2112 in Discussions on
46 Replies
Extentions Synchronization
Deleted in Discussions on
3 Replies
flashing a white screen while open new tab
Deleted in Discussions on
14 Replies
Security Community Webinars
Valon_Kolica in Security, Privacy & Compliance on
13 Replies
How to Prevent Teams from Auto-Launch
chenrylee in Microsoft Teams on
29 Replies
Stable version of Edge insider browser
HotCakeX in Discussions on
35 Replies