How to get current IP address, and use it as a condithion.

nnCron and nnCron LITE discussion

How to get current IP address, and use it as a condithion.

Postby Fantast.Leo.Dou » Wed, 06 Jul 2011, 16:47

In the help file, part of "Working with Windows Registry", I can't find a way to get a registry value that contain the current IP address:

HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\{8925C90D-09EA-4FA0-834D-D4E277309948}\Parameters\Tcpip
"IPAddress"=hex(7):31,00,30,00,2e,00,36,00,37,00,2e,00,31,00,30,00,34,00,2e,00,\
31,00,35,00,36,00,00,00,00,00

So how to get it? And compare it with an address like : 10.67.111.111, then if they are same, perform a task.
Fantast.Leo.Dou
 
Posts: 39
Joined: Wed, 23 Feb 2005, 07:29

Re: How to get current IP address, and use it as a condithio

Postby gost » Tue, 02 Aug 2011, 23:10

I am also in search of solution of that problem if you get answered of that than please inform me about this.

thanks to Fantast.Leo.Dou in advance for that.
gost
 
Posts: 1
Joined: Tue, 02 Aug 2011, 22:58

Re: How to get current IP address, and use it as a condithio

Postby MuR » Thu, 04 Aug 2011, 21:48

I tried this:

Code: Select all
#( CLASSIC-TASK-#-TestReg
  WatchHotKey: "^7"

  CREATE reg_value 256 ALLOT
Action:
    reg_value GET-REG: "HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\{4B3BBAA8-DABA-4431-858C-CD40774843A5}\Parameters\Tcpip\IPAddress"
    reg_value ASCIIZ> S" 192.168.56.1" COMPARE 0 = IF
      MSG: "Strings are the same"
    ELSE
      MSG: "Strings are different"
    THEN
)#


I hope it helps
MuR
 
Posts: 27
Joined: Thu, 10 Nov 2005, 08:58

Re: How to get current IP address, and use it as a condithio

Postby Fantast.Leo.Dou » Sat, 31 Dec 2011, 03:56

THX 2 MuR.


And 2 gost:

Actually, I had used AutoHotkey to do this.

Code: Select all
IfNotEqual, A_IPAddress1, 192.168.x.x
{

}
Return
Fantast.Leo.Dou
 
Posts: 39
Joined: Wed, 23 Feb 2005, 07:29

Re: How to get current IP address, and use it as a condithio

Postby francmulloy » Thu, 09 Feb 2012, 03:00

francmulloy
 
Posts: 1
Joined: Wed, 08 Feb 2012, 04:29


Return to nnCron forum (English)

Who is online

Users browsing this forum: No registered users and 4 guests