PDA

View Full Version : Some advice with if a member of type statements (WXP-Pro)



hardmandez
02-10-2004, 07:12 AM
Hi Everyone,


Could someone advise me or point me in the right direction, if it can be done at all how do get a script to do the following. I have been trying to use wscript stuff recently when automating tasks but I am still learning as I go along and not very much due to other work commitments.

I want to add a wscript to my unattended installation that will do the following kind of checks.

if the workstation is a member of "domain" then
run application
esle
run application
endif

Is there some sort of web resource that documents using system/network variables in your scripts?

Thanks

dineshcooper
02-19-2004, 04:31 PM
Hi

Below is some code you can use to get the domain a user belongs to, the computer name and the username

Set WshNetwork = WScript.CreateObject("WScript.Network")
WScript.Echo "Domain = " & WshNetwork.UserDomain
WScript.Echo "Computer Name = " & WshNetwork.ComputerName
WScript.Echo "User Name = " & WshNetwork.UserName

the documentation at
http://msdn.microsoft.com
should help