Kirix Support Forums
userid
3 posts
• Page 1 of 1
userid
How do I get the userid of the logged on user that is using kirix?
- abenitez77
- Registered User
- Posts: 143
- Joined: Fri Jan 21, 2011 12:42 pm
Re: userid
I'll piggyback on the back of that question... How can you get *any* system variable (not just USERNAME). I couldn't find a class that let you pull environmental variables beyond some of the display-related ones.
Thanks!
Thanks!
- SLSJax
- Registered User
- Posts: 11
- Joined: Fri Mar 18, 2011 10:40 am
Re: userid
To find out about the system environment, use the Environment class. For example, here's how to get the current user:
Environment.getEnvironmentVariable("USERNAME")
Here's a sample script that shows how to get the values for common system environment variables:
Environment.getEnvironmentVariable("USERNAME")
Here's a sample script that shows how to get the values for common system environment variables:
- Code: Select all
var env = new Array();
env.push("ALLUSERSPROFILE");
env.push("APPDATA");
env.push("COMPUTERNAME");
env.push("COMSPEC");
env.push("HOMEDRIVE");
env.push("HOMEPATH");
env.push("HOMESHARE");
env.push("LOGONSEVER");
env.push("OS");
env.push("PATH");
env.push("PATHEXT");
env.push("SYSTEMDRIVE");
env.push("SYSTEMROOT");
env.push("TEMP");
env.push("TMP");
env.push("USERDOMAIN");
env.push("USERNAME");
env.push("USERPROFILE");
env.push("WINDIR");
Console.clear();
for (var key in env)
{
var env_variable = env[key];
var env_value = Environment.getEnvironmentVariable(env_variable);
Console.writeLine(env_variable + ": '" + env_value + "'")
}
Aaron Williams
Kirix Support Team
Kirix Support Team
-
Aaron - Kirix Support Team
- Posts: 120
- Joined: Fri Dec 16, 2005 3:01 pm
3 posts
· Page 1 of 1
Return to Strata Help & Feedback