-
I was wondering what I need to do to be able to retrieve an environment variable, specifically the COMPUTERNAME environment variable. Thanks. Oh and I'm doing this in VBScript, so if it's different in VBScript, please tell me that way. Otherwise, I'll just try to do it the same as VB.
-
A little bit late but you can try this in your vbs-file and run it from the commandprompt with cscript.exe:
dim Server
Set Server = CreateObject("Wscript.Network")
strServer = server.ComputerName
wscript.echo "Servername = " & strServer
gr. Hans
-
how do I find the same but using VB? What is the reference?
-
It's almost the same
Make VB-project with a form and a command button "Command1":
Private Sub Command1_Click()
Dim Server
Set Server = CreateObject("Wscript.Network")
strserver = Server.ComputerName
MsgBox ("Servername: " & strserver)
End Sub
Reference:
http://msdn.microsoft.com/library/de...intro_0zsj.htm
gr. HansZ