หมวดไฟฟ้า/อิเล็กทรอนิกส์/คอมพิวเตอร์ => ห้องคอมพิวเตอร์ => Programming => ข้อความที่เริ่มโดย: Prog Man ที่ 17 มิถุนายน 2567, 14:58:24
-
หลายท่านอาจจะไม่รู้จักแบทช์ไฟล์ แต่ถ้าอายุสัก 50 อับ น่าจะพอรู้จักกันดี
ในสายของคอมพิวเตอร์
https://www.thaiall.com/assembly/batch.htm
ตัวอย่าง
@echo off
rem check to see if a file exists
if exist %1 goto fileexists
goto nofile
:fileexists
echo the file %1 exists
rem other commands here .....
goto end
:nofile
echo the file %1 does not exist
goto end
:end
-
อีกจ้าว
https://www.mindphp.com/forums/viewtopic.php?t=39086
-
ครั้งนี้ เรากลับมาต่อยอดจากความรู้พื้นฐานการใช้งาน Command Line กันครับ โดยการสร้าง Script ขึ้นมาและสั่งให้ Run คำสั่งที่เราเขียนไว้หลายๆ คำสั่งได้โดยอัตโนมัติ
Level 1: เริ่มต้นจากการนำคำสั่งพื้นฐานง่ายๆ มาเรียงต่อกัน
เริ่มต้นง่ายที่สุดโดยการเปิดโปรแกรม Notepad ขึ้นมา และพิมพ์ Command พื้นฐานลงไป
cd C:\Users\User\Desktop
mkdir TestFolder
echo some text > TestFolder\testFile.txt
dir TestFolder
บรรทัดแรก สั่งให้เข้าไปยัง Directory Desktop
บรรทัดที่สอง สั่งให้สร้าง Directory ชื่อ TestFolder
บรรทัดที่สาม สั่งให้สร้าง File ใน Directory TestFolder และใส่ข้อความ some text
บรรทัดสุดท้าย สั่งให้แสดงรายการ File และ Directory ที่อยู่ใน Directory TestFolder
ไปอ่านต่อกันที่นี่... (https://medium.com/arcadia-software-development/%E0%B8%A7%E0%B8%B4%E0%B8%98%E0%B8%B5%E0%B8%81%E0%B8%B2%E0%B8%A3%E0%B8%AA%E0%B8%A3%E0%B9%89%E0%B8%B2%E0%B8%87-batch-script-file-%E0%B9%81%E0%B8%9A%E0%B8%9A%E0%B8%9E%E0%B8%B7%E0%B9%89%E0%B8%99%E0%B8%90%E0%B8%B2%E0%B8%99-5-af46557192d7)
-
ธีการสร้างและเรียกใช้ไฟล์ Batch บน Windows 11/10
-
วิธีทำเมนูใช้งานแบตซ์ไฟล์ step by step