Máy chủ Windows 2003: tạo dịch vụ
Các chương trình có thể được tạo như các dịch vụ trong Windows Server 2003 để chúng được thực thi vĩnh viễn và mỗi khi hệ thống được khởi động. Điều này thậm chí hoạt động mà không cần người dùng đăng nhập. Bạn có thể đọc về cách thiết lập một ứng dụng trong mẹo thực tế này.
Windows Server 2003: Tạo một dịch vụ bằng cách sử dụng Công cụ tài nguyên
Nó tương đối dễ dàng với Windows Server 2003 Resource Kit Tools, bạn có thể tải xuống ở đây từ CHIP: Resource Kit Tools Download.
- Cài đặt các công cụ kit và tất nhiên chương trình sẽ được thiết lập như một dịch vụ. Ghi lại đường dẫn đầy đủ đến tệp * .exe của chương trình.
- Bắt đầu dòng lệnh (CMD) trong thư mục cài đặt của Công cụ Kit. Nhập lệnh sau đây: instsrv.exe [tên dịch vụ] [đường dẫn đến ứng dụng] \ srvany.exe, ví dụ instsrv.exe MeinDienst C: \ Program \ MeinDienst.exe \ srvany.exe và kết luận bằng "Enter",
- Với "Windows" + "R" mở cửa sổ chạy, nhập regedit.exe và nhấp vào Ok. Bây giờ hãy tìm khóa trong sổ đăng ký: HKEY_LOCAL_MACHINE \ HỆ THỐNG \ CurrentControlset \ Services \ [tên dịch vụ của bạn]. Bây giờ tạo một khóa con mới gọi là "Tham số". Đặt giá trị này: Tên: Kiểu dữ liệu ứng dụng: Chuỗi (REG_SZ) Giá trị: [Đường dẫn đến * .exe] Bây giờ hãy đóng trình chỉnh sửa sổ đăng ký.
- Dịch vụ này được tạo và bắt đầu tự động. Để thực hiện thay đổi, hãy mở Bảng điều khiển, sau đó "Công cụ quản trị" và cuối cùng là "Dịch vụ". Ở đó bạn cũng sẽ tìm thấy dịch vụ bạn đã tạo, nhờ đó bạn có thể thực hiện bất kỳ cài đặt nào.
Công cụ mạnh mẽ: SC.exe cho nhiều cài đặt dịch vụ
Với chương trình này, bạn cũng có thể trang bị thêm thông qua Windows Server 2003 Resource Kit Tools, bạn có thể tạo, chỉnh sửa và xóa hoàn toàn các dịch vụ thông qua dòng lệnh. Nó hoạt động như thế này.
- Mở lại dòng lệnh bằng cách bắt đầu Run ("Windows" + "R") cmd.exe.
- Tạo dịch vụ: sc tạo "MeinDienst" start = auto binpath = "C: \ Chương trình \ MeinDienst.exe"
- Định cấu hình dịch vụ để nó không tự động khởi động: sc config "Dịch vụ của tôi" start = bị vô hiệu hóa
- Thay đổi mô tả của dịch vụ: mô tả sc "MeinDienst" "Chương trình này được bắt đầu như một dịch vụ và luôn hoạt động."
Nói chung, chú ý đến không gian, vì những điều này dẫn đến khó khăn, đặc biệt là khi chỉ định đường dẫn. Nếu có thể, tránh những điều này hoàn toàn trong tên. Nếu bạn không muốn làm việc với dòng lệnh, hãy xem một trong những lựa chọn thay thế cho bảng điều khiển Windows của chúng tôi.