1 / 6

โครงสร้างคอมพิวเตอร์ และภาษาแอสเซมบลี้

โครงสร้างคอมพิวเตอร์ และภาษาแอสเซมบลี้. Copy by Batch File. ผศ.บุรินทร์ รุจจนพันธุ์ . ปรับปรุง 1 9 ตุลาคม 2555. มหาวิทยาลัยเนชั่น จังหวัดลำปาง http://www. nation.ac.th. ทบทวนคำสั่ง DOS. @echo off rem %0 คือ Batch File Name %1 คือ First Parameter shift set และ %x%.

tess
Télécharger la présentation

โครงสร้างคอมพิวเตอร์ และภาษาแอสเซมบลี้

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. โครงสร้างคอมพิวเตอร์ และภาษาแอสเซมบลี้ Copy by Batch File ผศ.บุรินทร์ รุจจนพันธุ์ . ปรับปรุง 19 ตุลาคม 2555 มหาวิทยาลัยเนชั่น จังหวัดลำปาง http://www.nation.ac.th

  2. ทบทวนคำสั่ง DOS @echo off rem %0 คือ Batch File Name %1 คือ First Parameter shift set และ %x% :label และ goto if == echo copy move cls

  3. อธิบาย copyto.bat COPYTO.BAT ใช้สำหรับคัดลอกแฟ้มต่าง ๆ เข้าไปในห้อง c:\x แต่คำสั่ง copy ไม่มีความสามารถนี้ จำเป็นต้องเขียน Batch File มาทำหน้าที่นี้ ด้วยการอ่าน parameter ไปคัดลอกทีละแฟ้ม คำสั่งสำคัญที่ใช้คือ if label shift และ copy ตัวอย่างการใช้ copyto.bat c:\x *.doc b.ppt c.xls

  4. copyto.bat c:\x *.doc b.ppt c.xls @echo off set destdir=%1 :start shift if "%1" == "" goto end copy %1 %destdir% goto start :end echo bye

  5. อธิบาย mcopy.bat MCOPY.BAT ใช้สำหรับนำ parameter มาจัดเรียงใหม่ตามที่ copyto.bat ต้องการ เมื่อเรียงใส่ตัวแปร copylist แล้วก็ส่งให้ copyto.bat ทำหน้าที่คัดลอกแต่ละแฟ้มต่อไป เพราะการส่งค่าให้ mcopy.bat เริ่มจาก source ไป destination ซึ่งนิยมใช้ในคำสั่งของทุกระบบ - ต้องใช้โปรแกรม Copyto.bat- ตัวอย่างการใช้copy.bat *.doc b.ppt c.xls c:\x

  6. mcopy.bat *.doc b.ppt c.xls c:\x @echo off set copylist= :start if "%2" == "" goto end set copylist=%copylist% %1 shift goto start :end set destination=%1 copyto %destination% %copylist%

More Related