Click to See Complete Forum and Search --> : Cannot write in DOS-window?????


stompinne
August 28th, 2002, 07:57 PM
i have to open MS-DOS-batchfile. In there i have to write something down. I open the DOS-window. I read in this window: "press any key". When i do press a key, THE WINDOW IS GONE.


Howcome???? What to do??

futuretech
August 29th, 2002, 12:51 AM
You need to edit the batch file. Open notepad and then file open and browse to the batch file and open it, edit or add the text needed and save and close.
This can be done from a command line as well using the edit command followed by the batch file name.
If batch file is called something like ipconfig.bat you would from a command prompt type edit ipconfig.bat
you would however need to switch to the directory where the batch file is stored.

As for why it opens and prompts to hit any key then closes, is because you are actually running the batch file not editing it, and it has the pause command in it. Pause keeps the window open and prompts for user input to close the window.

NooNoo
August 29th, 2002, 06:51 AM
You can also right click the file and select edit - selecting open will run the batch file.

Unfortunately unless you add a pause at the end of the file XP will close the the command line box. In 9x you had the check box that allowed you to control the behaviour of whether the dos prompt box remained open or closed automatically. There doesn't seem to be a control for this in XP.

What you can do however, is to start, run, type in cmd and press enter

This will open a cmd box (dos) you can then use dos commands to change directory to the batch file you wish to watch run and run it.. the cmd box opened this way will not close when the batch file finishes.