dspent Posted April 12, 2004 Share Posted April 12, 2004 (edited) Hello... I have a login script that I use to install some client agents for our Landesk network management software. However, I need to be able to prevent it from running on certain machines. I was hoping there was a way to code the script so that it will check the machine name and if it DOES contain the word CART in the machine name then it WILL NOT install the software. The machines that I need to prevent the install from happening on are all named 3TCART1 or 4WCART5 or 2ACART3....etc. etc. etc. according to their location in the building. Below is my current script....can someone please tell me what to add to it that will check to see if CART is in the machine name and then exit and if not it will continue on to the section that checks which OS is running etc... Thanks, Clarence *******SCRIPT********** #comments-start ---------------------------------------------------------------------------------- Landesk Client Configuration Agents Installer version 1.0 ---------------------------------------------------------------------------------- Author: DOMAIN ADMIN Date: 04/02/2004 #comments-end ;--------------------------------------------- ;First we declare the following variables ;--------------------------------------------- Dim $UserName, $DomainName, $Password, $RunProgram, $RunPath ;--------------------------------------------- ;Next we will assign values to those variables ;--------------------------------------------- $UserName = "admin" $DomainName = "*******" $Password = "*********" $RunProgram = "\\landesk03srv\ldlogon\wscfg32.exe /noui /noreboot" $RunPath = "\\landesk03srv\ldlogon\" ;------------------------------------------- ;Now perform the install based on OS ;------------------------------------------- IF @OSType = "WIN32_NT" THEN RunAsSet( $UserName, $DomainName, $Password ) $val = Run($RunProgram, $RunPath) RunAsSet() ELSEIF @OSType = "WIN32_Windows" THEN $val = Run($RunProgram, $RunPath) ENDIF ExIT Edited April 12, 2004 by dspent Link to comment Share on other sites More sharing options...
Valik Posted April 12, 2004 Share Posted April 12, 2004 Untested, see if this line works: If StringInStr(@ComputerName, "CART") Then Exit Link to comment Share on other sites More sharing options...
dspent Posted April 12, 2004 Author Share Posted April 12, 2004 Thanks Valik..... that works perfectly. Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now