Copy link to clipboard
Copied
Is there anyplace where the user name is stored and can be accessed by javascript? I doubt that it is stored anywhere that is accessible to the script.
Other than opening a dialog and asking for user entry is there any way that it could be made automagic?
Copy link to clipboard
Copied
Copy link to clipboard
Copied
Thank you so much. I had seen the $ (Class?) and taken a peek through its methods and properties using the object model viewer. I had seen getenv(), but didn't know how to use it—or really most of the other stuff in there.
$.getenv (name: string 😞 string
Core JavaScript Classes
Retrieves the value of an environment variable.
name: Data Type: string
The name of the variable.
The help says this about $.getEnv(), but how do I find the different strings for the environment variables?
Copy link to clipboard
Copied
See: http://en.wikipedia.org/wiki/Environment_variable
In Windows, all in Default Values on Microsoft Windows table are valid strings.
var environVar = ["ALLUSERSPROFILE", "PROGRAMDATA", "APPDATA", "COMPUTERNAME", "COMMONPROGRAMFILES", "COMMONPROGRAMFILES(x86)", "COMSPEC", "HOMEDRIVE", "HOMEPATH", "LOCALAPPDATA", "LOGONSERVER", "PATH", "PATHEXT", "PROGRAMFILES", "PROGRAMFILES(X86)", "PROMPT", "SystemDrive", "SystemRoot", "TEMP", "USERDOMAIN", "USERNAME", "USERPROFILE", "WINDIR", "PUBLIC", "PROGRAMDATA", "PSModulePath"], i = 0, len = environVar.length; for (; i< len; i++){ $.writeln(environVar + ': ' + $.getenv(environVar)); }