Is there a method to retrieve the windows domainname aka %USERDNSDOMAIN% environment windows variable?
I try with
application.executeProgram('cmd.exe', 'echo %USERDNSDOMAIN%')
but seems not work…
Is there a method to retrieve the windows domainname aka %USERDNSDOMAIN% environment windows variable?
I try with
application.executeProgram('cmd.exe', 'echo %USERDNSDOMAIN%')
but seems not work…
I am not sure this is possible right now.
When there is no easy solution I can add the following method to the Tools Plug-in:
getEnvironmentProperty(name)
When you want this please add a ticket to our support system at http://www.it2be.com/support (don’t forget to register first).
We could send you a test build today or tomorrow.
When you type ‘echo %USERDNSDOMAIN%’ in a DOS window you get no result (at least for me on XP). But when you use ‘echo %USERDOMAIN%’ then it does work so you might have a syntax issue here.
Another (Java native) way to get a system variable is to use the following code:
var sEnvVar = java.lang.System.getenv("USERDOMAIN");
application.output(sEnvVar); // debug
Hope this helps.
axterics:
Is there a method to retrieve the windows domainname aka %USERDNSDOMAIN% environment windows variable?
You can use```
var domain = java.lang.System.getenv(“USERDNSDOMAIN”);
The ROCLASI / joas hint works perfectly.
Thanks a lot guys
For IT2BE, I’m already registered to your website and I use your beatiful “tools” plugin. The trick seem to be not so complicated but if you want insert this function I’ll apprecciate