Computing.Net > Forums > Programming > Batch file wont continue without wi

Computer Problems? Computing.Net has over 1,000,000 posts about all things technology related! Over 90% answered within 24 hours! Click here to start participating now! Also, be sure to check out the New User Guide.

Batch file wont continue without wi

Reply to Message Icon

Name: vande
Date: October 16, 2008 at 04:45:13 Pacific
OS: Windows xp, Windows
CPU/Ram: 2.4 quad core Intel
Product: Dell, Dell, Dell
Comment:

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 related

Im 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..........



Sponsored Link
Ads by Google

Response Number 1
Name: IVO
Date: October 16, 2008 at 08:07:11 Pacific
Reply:

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.


0

Response Number 2
Name: vande
Date: October 16, 2008 at 16:08:15 Pacific
Reply:

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..........


0

Response Number 3
Name: IVO
Date: October 17, 2008 at 03:19:54 Pacific
Reply:

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).


0

Sponsored Link
Ads by Google
Reply to Message Icon

Related Posts

See More







Post Locked

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


Go to Programming Forum Home


Sponsored links

Ads by Google


Results for: Batch file wont continue without wi

Need Help with DOS batch file .. www.computing.net/answers/programming/need-help-with-dos-batch-file-/12751.html

Batch file hang www.computing.net/answers/programming/batch-file-hang/14248.html

Batch File Exe Program on Date www.computing.net/answers/programming/batch-file-exe-program-on-date/15176.html