Solved

How to interpret this program

Posted on 2011-09-21
5
176 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
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 54

Expert Comment

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

~bp
0

Featured Post

Free Tool: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

One of a set of tools we are providing to everyone 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

Title # Comments Views Activity
PDF-XChange Viewer Command Line for File -> Export -> Export as Image 2 846
Recursively Delete Files 5 111
Windows updates batch files 7 233
DOS Script 4 36
One of my most closely kept secrets is revealed in this discussion How to output text on the same line This question was recently posted in EE by Simon336697 (http://www.experts-exchange.com/Programming/Languages/Scripting/Shell/Batch/Q_2459…
TOMORROW TOMORROW.BAT is inspired by a question I get asked over and over again; that is, "How can I use batch file commands to obtain tomorrow's date?" The crux of this batch file revolves around the XCOPY command - a technique I discovered w…

751 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