Excellent thanks for that!
I forgot to mention though that its a kix script. Anyway I've solved it and this is an example of the script:
;##### Audit Software to run on seperat VLAN#####
$IP=@IPADDRESS0 ;get the workstation ip address
$IP=substr($IP, 1, 11) ;chop off the network portion
$vLAN2="172. 29.100" ;VLAN 2
$vLAN3="172. 29.101" ;VLAN 3
$vLAN4="172. 29.110" ;VLAN 4
$vLAN5="172. 29.111" ;VLAN 5
$vLAN6="172. 29.120" ;VLAN 6
$vLAN7="172. 29.121" ;OBP VLAN 7
;##### Execute Auditing Software#####
IF $IP=$vLAN2 ;
shell "\\servername\whatever\whatever\audit.exe"
ENDIF
The first line gets the ip address of the workstation
The second line gets the first three parts of the ip address (the last one not important as I wanted to audit subnets of the network independantly.)
The next lot of lines describe the subnets values
To execute select the subnet you want to audit and hey presto. Done