How To Create A Batch File In DOS And Gain Some Knowledge

Asked By 5 points N/A Posted on -
qa-featured

Hi. I am a student in standard twelve. I am planning to opt for Computer Science. How to create a batch file in DOS? Please reply ASAP. Thanks in advance.

SHARE
Answered By 10 points N/A #200416

How To Create A Batch File In DOS And Gain Some Knowledge

qa-featured

Hi. To learn how to create a batch file in DOS, first open the MS-DOS command window. Then, in the command prompt, type edit test.bat and then click on enter. Then, after a blue screen appears, type the code as-

@echo off

echo Hello world

pause

Dir c:windows

pause

After the above given code is typed, click on file and then select the exit option. Click on yes to save the file. Then, on the MS-DOS command prompt, first type test and then click on Enter. Since the first line which has been entered is pause, you will first have to press a key to continue.

You can also create a batch file by creating a blank text document on the desktop. Then, select the file menu and click on the save as option. Give the file a name and save it with the extension .bat. Then, click on save and close the window. Also ensure that the save as type has been changed to all files. Write the logic as mentioned in the code above inside the document and then complete the batch file.

Hope we helped.

Related Questions