FileReadLine, ipline, C:\ipaddr.txt, 1
FileReadLine, sernoline, C:\SerNo.txt, 1
; I don't think any of this part works.
; Stupid ass way to run functions... what's wrong with ipaddr := stringtrimleft, ipaddr, pos
colon := ":"
StringGetPos, pos, ipline, %colon% ; started as IP Address ....: 10.91.10.20
StringTrimLeft,ipaddr,ipline,%pos% ; should leave 10.91.10.20
StringGetPos, pos, ipaddr, . ; should find the first .
StringTrimLeft,ipline,ipaddr,%pos% ; and leave 91.10.20
StringTrimLeft,ipaddr, ipline, 1
StringGetPos, pos, ipaddr, .
StringTrimLeft,ipline,ipaddr,pos ; leaving 10.20
StringTrimLeft,ipaddr,ipline,1
StringGetPos, pos, ipaddr, . ; find the .
StringLeft,ipline,ipaddr,%pos% ; copy from left ... 10.
StringLeft,ipaddr,ipline,1
StringTrimRight,locationkey,ipaddr,1 ; kill the . leaving 10 in locatinkey
location := "none"
if locationkey between 213 and 215 location := "mse"
if locationkey between 217 and 219 location := "mss"
if locationkey between 209 and 211 location := "msw"
if locationkey between 233 and 235 location := "bes"
if locationkey between 221 and 223 location := "ges"
if locationkey between 229 and 231 location := "hes"
if locationkey between 225 and 227 location := "jes"
if locationkey between 237 and 239 location := "res"
if locationkey between 181 and 183 location := "les"
if location = "none" location := "lhs".
; can't get the damn thing to trim the crap before the first '
StringGetPos, pos, sernoline, '
StringTrimLeft, serno, sernoline, %pos%
StringTrimRight, sernol, serno, 1
StringTrimLeft, serno, sernol, 1
sernolen := strlen(serno)
if (sernolen < 5) {
msgbox "Invalid Serial Number"
exit 1
}
wsname := location . "-" . serno
; insert high quality debugging device
msgbox %wsname%
runwait, c:\program files\novell\zenworks\zwsreg.exe -unreg, ,hide
runwait, c:\program files\novell\zenworks\zwsreg.exe -workstation %wsname%, ,hide
runwait, c:\windows\system32\wsname.exe /N:%wsname%, ,hide
runwait, c:\windows\system32\ipconfig /registerdns, ,hide