Jump to content

Prevent Script From Running


Recommended Posts

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 by dspent
Link to comment
Share on other sites

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...