Windows Server 2003: สร้างบริการ
สามารถสร้างโปรแกรมเป็นบริการภายใต้ Windows Server 2003 เพื่อให้สามารถทำงานได้อย่างถาวรและทุกครั้งที่ระบบเริ่มทำงาน สิ่งนี้สามารถใช้งานได้โดยไม่มีผู้ใช้ที่เข้าสู่ระบบ คุณสามารถอ่านเกี่ยวกับวิธีตั้งค่าแอปพลิเคชันในเคล็ดลับที่ใช้งานได้
Windows Server 2003: สร้างบริการโดยใช้ Resource Kit Tools
มันค่อนข้างง่ายด้วย Windows Server 2003 Resource Kit Tools ซึ่งคุณสามารถดาวน์โหลดได้ที่นี่จาก CHIP: ดาวน์โหลด Resource Kit Tools
- ติดตั้งชุดเครื่องมือและแน่นอนโปรแกรมที่จะตั้งค่าเป็นบริการ จดบันทึกพา ธ ที่สมบูรณ์ไปยังไฟล์ * .exe ของโปรแกรม
- เริ่มบรรทัดคำสั่ง (CMD) ในโฟลเดอร์การติดตั้งของเครื่องมือชุด ป้อนคำสั่งต่อไปนี้ที่นั่น: instsrv.exe [ชื่อบริการ] [เส้นทางไปยังแอปพลิเคชัน] \ srvany.exe ตัวอย่างเช่น instsrv.exe MeinDienst C: \ Program \ MeinDienst.exe \ srvany.exe และจบด้วย "Enter",
- ด้วย "Windows" + "R" เปิดหน้าต่างการทำงานให้ป้อน regedit.exe และคลิกที่ตกลง ตอนนี้ค้นหาคีย์ในรีจิสทรี: HKEY_LOCAL_MACHINE \ SYSTEM \ CurrentControlSet \ Services \ [ชื่อของบริการของคุณ] ตอนนี้สร้างคีย์ย่อยใหม่ชื่อ "พารามิเตอร์" ระบุค่า: ชื่อ: แอปพลิเคชันชนิดข้อมูล: สตริง (REG_SZ) ค่า: [พา ธ ไปยัง * .exe] ตอนนี้ปิดตัวแก้ไขรีจิสทรี
- บริการนี้สร้างขึ้นและเริ่มต้นโดยอัตโนมัติ หากต้องการเปลี่ยนแปลงให้เปิดแผงควบคุมจากนั้นเลือก "เครื่องมือบริหารระบบ" และ "บริการ" ในที่สุด ที่นั่นคุณจะพบบริการที่คุณสร้างขึ้นซึ่งคุณสามารถทำการตั้งค่าใด ๆ
เครื่องมือที่มีประสิทธิภาพ: SC.exe สำหรับการตั้งค่าบริการมากมาย
ด้วยโปรแกรมนี้ซึ่งคุณสามารถติดตั้งเพิ่มเติมผ่านเครื่องมือ Kit ทรัพยากร Windows Server 2003 คุณสามารถสร้างแก้ไขและลบบริการได้อย่างสมบูรณ์ผ่านทางบรรทัดคำสั่ง มันใช้งานได้เช่นนี้
- เปิดบรรทัดคำสั่งอีกครั้งโดยเริ่มต้น Run ("Windows" + "R") cmd.exe
- สร้างบริการ: สร้าง sc "MeinDienst" start = auto binpath = "C: \ Program \ MeinDienst.exe"
- กำหนดค่าบริการเพื่อที่จะไม่เริ่มต้นโดยอัตโนมัติ: sc config "My services" start = disabled
- เปลี่ยนคำอธิบายของบริการ: คำอธิบาย sc "MeinDienst" "โปรแกรมนี้เริ่มต้นเป็นบริการและทำงานอยู่เสมอ"
โดยทั่วไปให้ความสนใจกับช่องว่างเนื่องจากสิ่งเหล่านี้นำไปสู่ความยากลำบากโดยเฉพาะเมื่อระบุเส้นทาง ถ้าเป็นไปได้หลีกเลี่ยงสิ่งเหล่านี้อย่างสมบูรณ์ในชื่อ หากคุณไม่ต้องการทำงานกับบรรทัดคำสั่งลองดูหนึ่งในตัวเลือกคอนโซล Windows ของเรา