Batch file question

Thraxen

Diamond Member
Dec 3, 2001
4,683
1
81
Is there a way to perform an action based on IP in a batch file? For example, if a computer's IP is 192.168.0.X then do some action.
 

sourceninja

Diamond Member
Mar 8, 2005
8,805
65
91
Yes it is possible, you are going to need to execute winipcfg or ipconfig and parse that to get the machine's ip. Then you can do an action based on that ip. I'm not sure why you would want to do that however.
 

QuixoticOne

Golden Member
Nov 4, 2005
1,855
0
0
You can probably pull it out of the registry.
If you write it in PowerShell it'll be VERY easy.