Windows 10 and shell

Hi
i need help to replace this code
dim sh as new Shell
sh.Execute(“echo %username%”) << i get nil on Windows 10 how i can get same info using other function

thanks

You should be able to use the Xojo function System.EnvironmentVariable:

var s as string
s = System.EnvironmentVariable("username")
1 Like

Thanks