I'm currently trying to write into our Kix scripts a section which checks the IP address and if it has a 10.20.x.x address then it creates a particular reg entry, otherwise it skips and goes to the next option within the script.

I've currently got the following....

 Code:
if Instr(@IPADDRESS," 10. 20")
	MD c:\Proxy_%username%
	COPY "\\mydomain\netlogon\file.pac" "c:\Proxy_@userid\file.pac"
	$key = "HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Internet Settings"
	WRITEVALUE($key,"AutoConfigURL","file://c:/proxy_@userid/file.pac","REG_SZ")
	WRITEVALUE($key,"ProxyEnable","0","REG_DWORD")
	WRITEVALUE("HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\Advanced", "Hidden", "2", "REG_DWORD")
ENDIF


This isn't working. Am I using the right commands/syntax or should I be using something else?

Any help is greatly appreciated.


Edited by Mart (2012-01-10 11:38 AM)
Edit Reason: Please use code tags when posting code.