Solved

How to interpret this program

Posted on 2011-09-21
5
169 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 51

Expert Comment

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

~bp
0

Featured Post

How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

Join & Write a Comment

VALIDATING DATES One method of validating dates is to jam the date into the DATE command and see if it accepts it by examining the system's errorlevel value. A non-zero result indicates failure. A typical example might look something like the fol…
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…
Internet Business Fax to Email Made Easy - With eFax Corporate (http://www.enterprise.efax.com), you'll receive a dedicated online fax number, which is used the same way as a typical analog fax number. You'll receive secure faxes in your email, fr…
Excel styles will make formatting consistent and let you apply and change formatting faster. In this tutorial, you'll learn how to use Excel's built-in styles, how to modify styles, and how to create your own. You'll also learn how to use your custo…

707 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

Need Help in Real-Time?

Connect with top rated Experts

17 Experts available now in Live!

Get 1:1 Help Now