![]() | คำสั่งภายใน และภายนอกของ DOS | ![]() |
|
คำสั่งภายใน (Internal Command)
คำสั่งภายนอก (External Command)
คำสั่งที่น่าสนใจ
| netstat -na ipconfig ping 127.0.0.1 -t explorer x.htm start x.bat exit |
| 1. เกี่ยวกับ Disk และ File | |
| 1. dir | แสดงรายชื่อแฟ้ม รายชื่อไดเรกทรอรี่ (File Listing in Directory)
C:\> dir /? C:\> dir format.com /s |
| 2. rename | เปลี่ยนชื่อแฟ้ม
C:\> ren a.com b.com |
| 3. copy | คัดลอกแฟ้ม
C:\> copy a.com b.com C:\> copy con a.bat C:\> echo a>a C:\> echo b>b C:\> copy a + b c |
| 4. xcopy | คัดลอกไดเรกทรอรี่ (Directory Copy)
C:\> xcopy c:\windows c:\win |
| 5. diskcopy | คัดลอกดิสก์จากแผ่นหนึ่งไปอีกแผ่นหนึ่ง
C:\> diskcopy a: b: |
| 6. chkdsk | เช็คดิสก์ และซ่อมส่วนที่เสียหาย (Fix error)
C:\> chkdsk c: C:\> chkdsk c: /f |
| 7. attrib | จัดการเกี่ยวกับ Attibute ของแฟ้ม
C:\> attrib C:\> attrib +h +r +s startdrv.exe |
| 8. label | เปลี่ยนลาเบล (Label) ของฮาร์ดดิสก์ (Harddisk)
C:\> label |
| 2. เกี่ยวกับ Directory Structure | |
| 1. cd | เปลี่ยนไดเรกทรอรี่ (Directory Changing)
C:\> cd c:\windows C:\> cd \ |
| 2. md | สร้างไดเรกทรอรี่ (Directory Makeing)
C:\> mk c:\win |
| 3. rd | ลบไดเรกทรอรี่ (Directory Removing)
C:\> rd c:\win C:\> |
| 4. tree | แสดงโครงสร้างไดเรกทรอรี่ (Tree of Directory)
C:\> tree C:\> tree c:\windows |
| 5. path | กำหนดเส้นทาง
C:\> path C:\> path = %path%;c:\windows |
| 3. เกี่ยวกับ Batch Processing | |
| 1. call | เรียก batch file อื่น
C:\> call x.bat C:\> |
| 2. echo | แสดงข้อความ
C:\> echo a C:\> echo a>b |
| 3. if | เลือกทำตามเงื่อนไข
C:\> C:\> |
| 4. goto | ไปยังลาเบล (Label)
C:\> :a C:\> goto a |
| 5. rem | หมายเหตุ
C:\> rem create june 12,2008 C:\> |
| 6. pause | หยุดรอ
C:\> pause C:\> |
| 7. for | ทำซ้ำ
C:\> C:\> |
| 8. shift | เลื่อนสำหรับ %0 ถึง %9
C:\> C:\> |
| 4. ทั่วไป (General) | |
| 1. date | ตั้งวันที่ หรือแสดงวันที่ปัจจุบัน
C:\> date 12-31-2008 |
| 2. time | ตั้งเวลา หรือแสดงเวลาปัจจุบัน
C:\> time 12:12:12 |
| 3. prompt | ตั้งเครื่องหมาย prompt ใหม่
C:\> prompt C:\> prompt $p$t$g |
| 4. cls | ลบจอภาพ
C:\> cls |
| 5. type | แสดงข้อมูลในแฟ้มข้อความ (Text File)
C:\> type x.bat |
| 6. set | กำหนดตัวแปร
C:\> set a=c:\x.bat C:\> echo %x% |
| 7. ver | แสดงเลขรุ่นของระบบปฏิบัติการ
C:\> ver Microsoft Windows XP [Version 5.1.2600] |