0

Value obtained by using System.getProperty (" user.name ") does not match folder name under C:\Users\

I wonder if there is a way to get the folder name under C:\Users\ of the account you are currently using.

I am using Java.

Sandeep Singh
  • 745
  • 4
  • 20
정승리
  • 1
  • 1

1 Answers1

0

Sometime the OS not get ("user.name"),but there can be another way, just try

String username = System.getProperty("user.name");

String username = System.getenv("USERNAME");

Nifras Nipy
  • 101
  • 1
  • 3