Hello
I have written a wsh login script but I am having difficulty with one part of it. The script firstly gets the ip address of the machine i want the script to exit if the ip address matches 4 ip addresses I specify I can't seem to get it to work. the extract of code is below.
'Declare Global Variables
Dim shell,machine_name,fso, net, User, IPConfigSet, TextStreamObject, DomainName, strFileNames, Hwnd, ip1, ip2
Dim IP_Address : IP_Address = GetIP()
'Constants
Const C_machine = "HKLM\SYSTEM\CurrentControlSet\Control\ComputerName\ComputerName\"
Const C_roam = "HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Winlogon\"
Const C_master = "HKLM\SYSTEM\CurrentControlSet\Services\Browser\Parameters\"
Const xpver = "HKLM\SYSTEM\CurrentControlSet\Control\Session Manager\Environment\"
Const C_bmp = "c:\pa.bmp"
Const C_hosts = "c:\newhost"
Const C_keyboard = "c:\copykey20052002"
Const C_netset = "c:\netset"
Const C_xpcache = "c:\winnt\xpcache.ini"
Const C_harrisini = "c:\harrisini3007"
Const C_xpver = "c:\xpverdone"
ip1 = left(ip_address,11)
ip2 = right(ip_address,7)
msgbox ip2
if not ip2 = "102.153" or ip2 = "102.140" Then
do all the scripts stuff
Else
End the script !!
It works by having jsut one ip address to check against but with more than one it doesn't work
Surely there must be a way to do this
Thanks in advance.
Richard
I have written a wsh login script but I am having difficulty with one part of it. The script firstly gets the ip address of the machine i want the script to exit if the ip address matches 4 ip addresses I specify I can't seem to get it to work. the extract of code is below.
'Declare Global Variables
Dim shell,machine_name,fso, net, User, IPConfigSet, TextStreamObject, DomainName, strFileNames, Hwnd, ip1, ip2
Dim IP_Address : IP_Address = GetIP()
'Constants
Const C_machine = "HKLM\SYSTEM\CurrentControlSet\Control\ComputerName\ComputerName\"
Const C_roam = "HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Winlogon\"
Const C_master = "HKLM\SYSTEM\CurrentControlSet\Services\Browser\Parameters\"
Const xpver = "HKLM\SYSTEM\CurrentControlSet\Control\Session Manager\Environment\"
Const C_bmp = "c:\pa.bmp"
Const C_hosts = "c:\newhost"
Const C_keyboard = "c:\copykey20052002"
Const C_netset = "c:\netset"
Const C_xpcache = "c:\winnt\xpcache.ini"
Const C_harrisini = "c:\harrisini3007"
Const C_xpver = "c:\xpverdone"
ip1 = left(ip_address,11)
ip2 = right(ip_address,7)
msgbox ip2
if not ip2 = "102.153" or ip2 = "102.140" Then
do all the scripts stuff
Else
End the script !!
It works by having jsut one ip address to check against but with more than one it doesn't work
Surely there must be a way to do this
Thanks in advance.
Richard