1 / 6

DOS BATCH FILE

DOS BATCH FILE. Berisi daftar instruksi / perintah sistem operasi yang disimpan dalam sebuah file Bukan bahasa programan Extention File BAT Dengan sebuah file berextensi *.bat, beberapa instruksi DOS dapat dijalankan sekaligus hanya dengan mengetikkan file *.bat tersebut

yamka
Download Presentation

DOS BATCH FILE

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. DOS BATCH FILE • Berisi daftar instruksi / perintah sistem operasi yang disimpan dalam sebuah file • Bukan bahasa programan • Extention File BAT • Dengan sebuah file berextensi *.bat, beberapa instruksi DOS dapat dijalankan sekaligus hanya dengan mengetikkan file *.bat tersebut • Dibuat dengan menggunakan Text Editor, seperti Notepad, Edit.Com, vi, dll • Contoh : Autoexec.Bat

  2. Perintah-perintah Batch File • ECHO = digunakan untuk teks • @ECHO • @ECHO OFF • @ECHO. | ECHO. • @REM = memberi komentar • PAUSE = untuk menghentikan sementara • > = menyimpan ke file baru • >> = disimpan di dalam file baru • > NUL = pengosongan perintah • CALL = mengeksekusi file lain

  3. Perintah-perintah Batch File • IF = pernyataan kondisi • GOTO = menuju ke label tertentu • EXIST = periksa keberadaan object • EXIT = keluar dari shell DOS • Instruksi-instruksi DOS • CLS • MD • CD • COPY

  4. Contoh Batch File Test.Bat CLS ECHO file test.bat @ECHO tampil pada baris 1 @ECHO tampil pada baris 2 @ECHO tampil pada baris 3 ECHO ECHO OK @ECHO. @ECHO. @ECHO tampil pada baris 4 @ECHO OFF @ECHO OFF @ECHO tampil pada baris 5 @ECHO @REM latihan batch file C:\>ECHO file test.bat file test.bat tampil pada baris 1 tampil pada baris 2 tampil pada baris 3 C:\>ECHO ECHO is on. C:\>ECHO OK OK tampil pada baris 4 tampil pada baris 5 ECHO is off.

  5. Contoh Batch File Latih.Bat CLS @REM ************************************* @ECHO latihan batch file lanjutan PAUSE > NUL @ECHO OFF @ECHO > hasil.txt @ECHO texs hasil batch file baris 1 >> hasil.txt @ECHO texs hasil batch file baris 2 >> hasil.txt IF EXIST hasil.txt GOTO SUKSES :SUKSES @ECHO file hasil sukses dibuat @ECHO OK hasil.txt > nul CALL test.bat EXIT latihan batch file lanjutan C:\>NUL file hasil sukses dibuat OK ECHO is off. texs hasil batch file baris 1 texs hasil batch file baris 2

  6. Autoexec.Bat @ECHO OFF PROMPT DONNY $Q$G $P $G PATH=C:\DOS;C:\WINDOWS SET TEMP=C:\TEMP SET BLASTER=A220 I7 D1 T2 DOSKEY C:\WINDOWS\SMARTDRV.EXE 2038 512 C:\WINDOWS\MOUSE.COM /Y CD WINDOWS

More Related