Solved

How to interpret this program

Posted on 2011-09-21
5
174 Views
Last Modified: 2012-05-12
How do you interpret the program below:

 Ipconfig.bat
Line 1: @echo off
Line 2: @start "IPCONFIG /all" /D "%SystemRoot%/system32" /B "%SystemRoot%/system32/Ipconfig.exe" /all >d:\IP.txt
Line 3: pause
Line 4: exit
0
Comment
Question by:peterliong
5 Comments
 
LVL 13

Expert Comment

by:lee555J5
ID: 36578234
@echo off
Turns off command echoing so you don't see the commands typed, only the results.

@start "IPCONFIG /all" /D "%SystemRoot%/system32" /B "%SystemRoot%/system32/Ipconfig.exe" /all >d:\IP.txt
start runs a command
The first "IPCONFIG /all" is a title.
/D path
/B command/program
> d:\IP.txt redirects the output to a text file instead of the screen.

pause
Waits for a key

exit
Quits the program

Type the DOS commands in the search box here.

Lee
0
 

Author Comment

by:peterliong
ID: 36578259
So what is printed in the text file?
0
 
LVL 13

Accepted Solution

by:
lee555J5 earned 500 total points
ID: 36578279
The results of the "ipconfig /all" command. Open a command prompt and type that command and see what you get. You should get your ip address, subnet mask, default gateway, DNS servers, WINS servers, etc., for all configured network adapters.
0
 
LVL 43

Expert Comment

by:Steve Knight
ID: 36579257
/B says not to open a new window for the program.


You don't need start btw, perhaps just this... leave off the title too if not needed.  Don't call it ipconfig.cmd otherwise it will go in infinite loop...

@echo off
Title "Results of IPCONFIG command"
Ipconfig /all >d:\IP.txt
pause


0
 
LVL 53

Expert Comment

by:Bill Prew
ID: 37123487
Do you have any further questions peterliong?

~bp
0

Featured Post

Free Tool: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Using dates in 'DOS' batch files has always been tricky as it has no built in ways of extracting date information.  There are many tricks using string manipulation to pull out parts of the %date% variable or output of the date /t command but these r…
YESTERDAY YESTERDAY.BAT is inspired by a previous article I wrote entitled: TOMORROW.BAT (http://www.experts-exchange.com/OS/Microsoft_Operating_Systems/MS_DOS/A_4196-Advanced-Batch-File-Programming-TOMORROW-BAT.html). The crux of this batch f…
I've attached the XLSM Excel spreadsheet I used in the video and also text files containing the macros used below. https://filedb.experts-exchange.com/incoming/2017/03_w12/1151775/Permutations.txt https://filedb.experts-exchange.com/incoming/201…

831 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question