vbScript that Checks NetworkAdapter Config and updates URL if it detects change -
ok... here seems way more educated stuff i. i've been @ 2 days straight , i've gone @ kinds directions.
goal:
have script check ip address of local pc. @ time (thinking 5 minutes) recheck ip address again. compare 2 , if there change execute command silently.
i realize can not ip address i'll entire state using winmgmts , i'm ok that. it's keep eye on whether or not state changes in general. line of code access url update freedns incase ip changes. whatever reason, none of programs offered have been working. 1 crashes .net framework.
knowing i'm utter noob (and thank reading far!) here's crazy broken , utterly bizarre code looks like. assistance divine , apologize
dim firstset, secondset set objwmiservice = getobject("winmgmts:") set firstip = objwmiservice.execquery("select * " & "win32_networkadapterconfiguration ipenabled = true") set firstset = firstip wscript.sleep 3 set objwmiservice = getobject("winmgmts:") set secondip = objwmiservice.execquery("select * " & "win32_networkadapterconfiguration ipenabled = true") set secondset = secondip results = strcomp(firstset, secondset, 1) if not results = true updateurl = "myurl" set req = createobject("msxml2.xmlhttp.6.0") req.open "get", updateurl, false req.send end if
Comments
Post a Comment