การใช้คำสั่ง เกี่ยวกับ file, Remote บน MS-DOS Prompt


คำสั่งบน Dos ช่วยให้การทำงานบางส่วนของงานเร็วขึ้น

Command

Meaning

cls

Clears หน้าจอ  MS-DOS Prompt window และ prompt จะอยู่บรรทัดแรกของหน้าจอ

cd DIRNAME

MS-DOS ทำงานอยู่ directory อันใดอันหนึ่ง directory ปัจจุบันจะเห็นเป็นส่วนหนึ่งของ prompt บนหน้าจอ เช่น  "C:WINDOWSDesktop>" หมายความว่า directory ปัจจุบัน คือ "Desktop" directory  ซึ่งอยู่ภายใน Windows directory เราใช้คำสั่ง cd เพื่อเข้าถึง directory อื่นเพื่อให้เป็น current directory (cd=change directory) ตัวอย่างการใช้คำสั่ง; "cd perl" will make "perl" the current directory. To get to the "root" of your c: drive, type "cd ".

dir
dir DIRNAME

"dir" lists the contents of the current directory. "dir DIRNAME" lists the contents of the DIRNAME directory, e.g.: "dir perl" or "dir mystuff". If you add " /p" to the end of the command, such as "dir mystuff /p", then the output will pause after each screenful and wait for you to press any key (e.g.: Enter).

notepad FILENAME

Starts the Notepad text editor program and opens the file named FILENAME. If the file does not exist, Notepad will ask you if you want to create a new file with that name. For example, "notepad allposters.ini" starts Notepad and opens the file allposters.ini located in the current directory. If you want to edit a file that is in a directory other than the current directory, then use the "cd" command first or include the directory name, such as: "notepad wwwallpostersallposters.ini".

type FILENAME

Displays on the screen the contents of the file named FILENAME. For example, "type ae.key" displays the contents of the file ae.key located in the current directory. If you want to display a file that is in a directory other than the current directory, then use the "cd" command first or include the directory name, such as: "type wwwaeae.key". Note: If the contents of the file is more than one screenful, then you should use the "more" command instead otherwise the text will scroll off the top of the window.

more FILENAME

Displays on the screen the contents of the file named FILENAME. For example, "more ae.ini" displays the contents of the file ae.ini located in the current directory. If you want to display a file that is in a directory other than the current directory, then use the "cd" command first or include the directory name, such as: "more wwwaeae.ini". Note: If the contents of the file is more than one screenful, then "-- More --" will appear after each screenful and your computer will wait for you to press the Enter key to continue or press q (or Ctrl-C) to quit.

start .

The command "start ." (the . is required, and there must be a space before it) causes the current directory to be shown graphically as a folder.

copy NAME1 NAME2

Copy the file that has name NAME1 to NAME2. The file NAME1 is unchanged. If a file with the name NAME2 already exists, you will be asked if you want to overwrite the current NAME2 file. For example, "copy allposters.ini allposters.bkp" copies allposters.ini to allposters.bkp.

ren NAME1 NAME2

Rename the file that has name NAME1 to NAME2. If NAME2 already exists, then an error message is shown instead. For example, "ren allposters.ini allposters.bkp" renames allposters.ini to allposters.bkp.

del FILENAME

Delete file that has the name FILENAME. The file FILENAME is immediately deleted without any confirmation.

WARNING: Do not delete anything unless you know exactly what you are doing. MS-DOS does not have a "Recycle Bin" so you cannot recover files deleted with the "del" command.

WARNING: The character * is the wildcard character and allows you to delete all matching files by using one command, such as "del *.tmp" deletes all files that end with ".tmp" in their filename. All matching files are immediately deleted without any confirmation and cannot be recovered.

md DIRNAME

Make a new directory named DIRNAME inside the current directory. If you want to make the new directory inside a directory other than the current directory, then use the "cd" command first. For example, "md allposters" makes a new directory called "allposters" inside the current directory.

exit

Closes the MS-DOS Prompt window. Equivalent to clicking on the "X" close button (top right of the window frame).

คำสำคัญ (Tags): #uncategorized
หมายเลขบันทึก: 13729เขียนเมื่อ 28 มกราคม 2006 15:05 น. ()แก้ไขเมื่อ 21 มิถุนายน 2012 15:43 น. ()สัญญาอนุญาต: จำนวนที่อ่านจำนวนที่อ่าน:


ความเห็น (1)
ดีจัง ได้เจอ Gosling ด้วย
พบปัญหาการใช้งานกรุณาแจ้ง LINE ID @gotoknow
ClassStart
ระบบจัดการการเรียนการสอนผ่านอินเทอร์เน็ต
ทั้งเว็บทั้งแอปใช้งานฟรี
ClassStart Books
โครงการหนังสือจากคลาสสตาร์ท