Solved

How to interpret this program

Posted on 2011-09-21
5
177 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 56

Expert Comment

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

~bp
0

Featured Post

Windows Server 2016: All you need to know

Learn about Hyper-V features that increase functionality and usability of Microsoft Windows Server 2016. Also, throughout this eBook, you’ll find some basic PowerShell examples that will help you leverage the scripts in your environments!

Question has a verified solution.

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

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…
Being a system administrator some time we require to do things remotely, one of them is installing software. Here I am going to tell you how to install software through wmic (Windows management instrument console). I am not at all saying that this i…
If you’ve ever visited a web page and noticed a cool font that you really liked the look of, but couldn’t figure out which font it was so that you could use it for your own work, then this video is for you! In this Micro Tutorial, you'll learn yo…
Do you want to know how to make a graph with Microsoft Access? First, create a query with the data for the chart. Then make a blank form and add a chart control. This video also shows how to change what data is displayed on the graph as well as form…

632 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