Page 1 of 1 1
Topic Options
#213751 - 2019-10-07 01:43 PM How to prevent Kix script running if a condition is not met
Icebun Offline
Fresh Scripter

Registered: 2007-07-19
Posts: 8
Loc: UK
For some laptop users, that connect to the network using a (Watchguard) VPN client, I need to first check if the VPN has been activated before running Kixtart.

When the VPN is running, a particular process (wgsslvpnsrc.exe) will be running in Task Manager or an IP address (10.100.106.x) will be allocated from a pool.


Is it possible for kixtart to detect either of these?

If so, a hint on the syntax would be useful.

Thanks.

Top
#213753 - 2019-10-07 01:57 PM Re: How to prevent Kix script running if a condition is not met [Re: Icebun]
Glenn Barnas Administrator Offline
KiX Supporter
*****

Registered: 2003-01-28
Posts: 4396
Loc: New Jersey
Check out this UDF which returns a list of running processes.

The last post in that thread has some examples - basically, check for that process and exit if it is present/running.

Glenn
_________________________
Actually I am a Rocket Scientist! \:D

Top
#213755 - 2019-10-07 04:53 PM Re: How to prevent Kix script running if a condition is not met [Re: Icebun]
Mart Moderator Offline
KiX Supporter
*****

Registered: 2002-03-27
Posts: 4672
Loc: The Netherlands
Another option would be to check the IP address.
Please be aware that @IPADDRESS marcos return three characters for each octet. So "10.1.20.123" will be " 10. 1. 20.123". Counting 12 characters from the left will give you everything from the left including the dot between the third and fourth octet.

 Code:
If Left(@IPADDRESS0, 12) <> " 10.100.106."
	;Do stuff if NOT on VPN
Else
	;Do stuff for VPN users or just do nothing
EndIf
_________________________
Mart

- Chuck Norris once sold ebay to ebay on ebay.

Top
#213756 - 2019-10-09 08:00 AM Re: How to prevent Kix script running if a condition is not met [Re: Mart]
Icebun Offline
Fresh Scripter

Registered: 2007-07-19
Posts: 8
Loc: UK
Guys,

I really appreciated the responses!

Mart, I have applied your solution and this works.

Thanks again everyone and its really nice to know Kixtart still lives on.

Top
Page 1 of 1 1


Moderator:  Jochen, Allen, Radimus, Glenn Barnas, ShaneEP, Ruud van Velsen, Arend_, Mart 
Hop to:
Shout Box

Who's Online
0 registered and 248 anonymous users online.
Newest Members
gespanntleuchten, DaveatAdvanced, Paulo_Alves, UsTaaa, xxJJxx
17864 Registered Users

Generated in 0.056 seconds in which 0.027 seconds were spent on a total of 13 queries. Zlib compression enabled.

Search the board with:
superb Board Search
or try with google:
Google
Web kixtart.org