How to run different install scripts based on a location property

(imported topic written by SystemAdmin)

I have many sites and would like to run different scripts based on a “Location” property that im using

“Location”

SITE1

SITE2

SITE3

SITE4

SITE5

Location scripts

SITE1.script.vbs

SITE2.script.vbs

SITE3.script.vbs

I would automatically like to run the proper script based on the “Location” property which is set to SITE1 or SITE2… per server, also I would like it not to run a script (or error) if the location script name is not available

Thanks in advance

(imported comment written by jessewk)

Use relevance something like:

exists value of setting “Location By Subnet” of client

And use an action something like:

waithidden wscript.exe {value of setting “Location By Subnet” of client}.script.vbs

However, if you tell me what version your clients are at and how you intend to distribute the scripts, I may give you a different answer. Also, does the location ever change and thus you need to re-run a new script?

Jesse

(imported comment written by SystemAdmin)

7.1.1.315

im trying something like this…

so the script name would be like “SITE1-SilentInstall.cmd”

since i cant prefetch it or check the sha1 of it because there could be 50+ of them

parameter “Site-Location” = {(substring after “Location=” of (setting “Location” of client as string))} & “-SilentInstall.cmd”

download http:///shared/PC_Clnt/{parameter “Site-Location” of action}

(imported comment written by jessewk)

If you upgrade to 7.2 it becomes very easy.

  1. Create a text file

manifest.txt

which is a manifest of the scripts and their sha1s like this:

SITE1-SilentInstall.cmd sha1=abcdef123456789;size=1234
SITE2-SilentInstall.cmd sha1=abcdef123456789;size=1234

SITEN-SilentInstall.cmd sha1=abcdef123456789;size=1234

  1. Create a folder

silentinstalls

in the wwwrootbes folder

  1. Place

manifest.txt

and all of your .cmd scripts into the folder you created in step 2

  1. Create an action like this:

begin prefetch block

add prefetch item name=manifest.ini sha1=abcdef123456789 size=1234 url=http://127.0.0.1:52311/slientinstalls/manifest.txt

collect prefetch items

add prefetch item name=SilentInstall.cmd sha1={preceding text of first “;” of following text of first “sha1=” of line whose (it starts with (value of setting “Location” of client) as string) of download file “manifest.txt”} size={following text of first “size=” of line whose (it starts with (value of setting “Location” of client) as string) of download file “manifest.txt”} url=http://127.0.0.1:52311/slientinstalls/{value of setting “Location” of client}-SilentInstall.cmd

end prefetch block

waithidden “{download path “SilentInstall.cmd”}”

That’s it. But, your client has to be version 7.2… good incentive to upgrade?

Also, just to note… you don’t need to manually parse the setting value. Just use ‘value of setting “Location” of client’.

Jesse