|
-
May 5th, 2000, 05:03 AM
#1
Thread Starter
Hyperactive Member
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.
-Ryan
I smell varmint poontang, and the only good varmint poontang is dead varmint poontang...
-Bill Murray, Caddyshack
-
Dec 18th, 2000, 09:37 AM
#2
Junior Member
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
-
Apr 25th, 2001, 11:12 AM
#3
PowerPoster
how do I find the same but using VB? What is the reference?
-
Apr 26th, 2001, 02:33 AM
#4
Junior Member
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
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|