A Windows user can still use the above MS-DOS steps if they wish to
create a batch file. If, however, you're more comfortable using
Microsoft Windows or your operating system, you can use any text editor,
such as Notepad or Wordpad, to create your batch files, as long as the
file extension ends with .bat. In the below example we use the Windows
notepad to create a batch file.
- Click Start
- Click Run
- Type: notepad and press enter.
- Once notepad is open, type the code lines in the file or copy and paste the below lines into notepad.
@echo off
echo Hello this a test batch file
pause
(this is not a complete code) - Click File and click Save; browse to where you want to save the file. For the file name, type "test.bat", and if your version of Windows has a "Save as type" option, choose "All files", otherwise it will save as a text file. Once all of this has been done click the Save button and exit notepad.
- Now, to run the batch file, double-click or run the
file like any other program. Once the batch file has completed running
it will close the window automatically.
No comments:
Post a Comment