Set WshShell = WScript.CreateObject("WScript.Shell")
Set WshSysEnv = WshShell.Environment("SYSTEM")
WScript.Echo WshSysEnv("NUMBER_OF_PROCESSORS")
This works ok. We however want to get at the environment variable
'USERNAME'. We have tried things like:
Set WshShell = WScript.CreateObject("WScript.Shell")
Set WshSysEnv = WshShell.Environment("PROCESS")
WScript.Echo WshSysEnv("USERNAME")
and
Set WshShell = WScript.CreateObject("WScript.Shell")
Set WshSysEnv = WshShell.Environment("USER")
WScript.Echo WshSysEnv("USERNAME")
but we just get a blank for the username. Other environment variables work
OK.
Any ideas?
Cheers
Mike
Set WshNet = CreateObject("WScript.Network")
WScript.Echo WshNet.username
Mike
"Mike Varley" <mi...@nacstock.ac.uk> wrote in message
news:enRgk2MLCHA.1624@tkmsftngp10...
Lee.
--
___________________________________
Outlook Web Access for PDA and WAP:
www.leederbyshire.com
___________________________________
"Mike Varley" <mi...@nacstock.ac.uk> wrote in message
news:enRgk2MLCHA.1624@tkmsftngp10...
set net = createObject("wscript.network")
msgbox net.username
You're better off following Lee's advice - use authentication and get the info server side rather than using unsafe ActiveX components on the client...
--
Michael Harris
Microsoft.MVP.Scripting
Seattle WA US
--