Go Premium for a chance to win a PS4. Enter to Win

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 181
  • Last Modified:

How to interpret this program

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
peterliong
Asked:
peterliong
1 Solution
 
lee555J5Commented:
@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
 
peterliongAuthor Commented:
So what is printed in the text file?
0
 
lee555J5Commented:
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
 
Steve KnightIT ConsultancyCommented:
/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
 
Bill PrewCommented:
Do you have any further questions peterliong?

~bp
0

Featured Post

NFR key for Veeam Agent for Linux

Veeam is happy to provide a free NFR license for one year.  It allows for the non‑production use and valid for five workstations and two servers. Veeam Agent for Linux is a simple backup tool for your Linux installations, both on‑premises and in the public cloud.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now