Tom's Guide | Tom's Hardware | Tom's Games
![]() |
![]() |
![]() |
Ok so im trying this concept and im trying to for right now with a basic ipconfig. I will explain later why and what im doing but for now this is my current batch file
@echo off
ipconfig > ipconfig.txt
exit
What im trying to accomplish is simply ipconfig and redirect it to a .txt file which works however when i place into a .bat file it will not completly finish until i close the command (CMD) window........ I have had many occurances where this is the case for instance i made a little defragmentation script for my grandmother. I know i know windows will do it but i wanted to build one..... So the script starts and it prompts her with a notepad explaining what is going on however nothing will happen until she closes notepad ...... regardless this is not the issue but it would be nice to find a solution and it would be very nice if they were relatedIm a beginner at this so i tried @echo off
but i learned that this just does not post your code in the CMD window. :(Learning in progress..........

The straightforward script you post has no reason that prevents it to terminate and close by itself the cmd window that is just the effect of the exit statement.
About the Notepad issue the commands in a batch are executed sequentially (step by step) and to force parallel processing you need to code
Start "" Notepad Your_Text_File
but that is no way related to this thread.

Start "" Notepad Your_Text_File
Ok can you explain a little better for me sorry this stuff im in the process of learning so what others may think wow what a dummy this is an easy concept
I will think the same way some day but for now i need detailed information :)
Start "" Notepad Your_Text_File
so im doing a call on the notepad file
would i want to have a start?and why by calling Notepad to start is this needed? I have the doument saved as a .txt file just the default program that reads in .txt is notepad.
Start "" Notepad Your_Text_File
so would i do this
Start "c:\defragnotice.txt" ?Learning in progress..........

Start "" "c:\defragnotice.txt"
is the same as
Start "" Notepad "c:\defragnotice.txt"
but first of al please pay attention to the pair of double quotes after the Start command. They are required when the operand path is embedded between quotes as you coded. The general format (omitting more complex switches and options) is
Start "Window's title" Program_Name [Program's operands]
As .txt files are associated with Notepad you can omit the program name; I just posted the most general format.
You must invoke the Start command to run an application if you want the batch goes on in its own processing while the previous program is still running or to open another batch in a separate window. Otherwise the script suspends to execute until the called application is not terminated.
This is named parallel processing or multitasking opposite to step by step execution that is the usual way a batch performs.
To know more about the parametes of commands type /? at prompt after the comand code, e.g. Start /? (note the /W switch to synchronize tasks' execution).

![]() |
![]() |
![]() |

This post is quite old and has been locked from receiving new replies. Please create a new posting instead.
| Ads by Google |