dspent 0 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 Share this post Link to post Share on other sites
Valik 478 Posted April 12, 2004 Untested, see if this line works: If StringInStr(@ComputerName, "CART") Then Exit Share this post Link to post Share on other sites
dspent 0 Posted April 12, 2004 Thanks Valik..... that works perfectly. Share this post Link to post Share on other sites