Get IP in MS-DOS

Associate
Joined
13 May 2007
Posts
1,832
Location
Lancashire, UK
OK just to make it clear to start off with... I'm not talking about windows XP dos, I'm talking about old school MS-DOS.

I need to know how to output the IP address of a machine in MS-DOS and if possible I then need to grab the 3 octave (192.168.X.1) so I can set it as a variable.

I've made a batch file which does this perfectly in Windows XP, but doesn't work in older versions of DOS.

Anyone got any ideas ?
 
That's a tricky one because old school MS-DOS isn't network aware so is reliant on other software and drivers for connectivity. Do you have access to the hostname and ping commands in your config? You could use those to get the machine's own hostname and then ping it to get the IP.
 
The only network parts currently in the image are to load the network drivers. I can add files easily to the image so if there are any tools which can make the image ping itself then that would be handy.
 
Back
Top Bottom