服務的工作目錄始終是System32。這是不可配置的。您將需要確保任何不在System32服務中的依賴關係都能夠加載。對於靜態依賴關係,通常在系統事件日誌(eventvwr.msc)中查找錯誤記錄就足夠了。如果您發佈更多關於哪種依賴關係(例如託管/非託管/運行時)的詳細信息,我可以提供更具體的解決方案。
服務恢復選項是可配置的使用SC.EXE:
c:\>sc failure /?
DESCRIPTION:
Changes the actions upon failure
USAGE:
sc <server> failure [service name] <option1> <option2>...
OPTIONS:
reset= <Length of period of no failures (in seconds)
after which to reset the failure count to 0 (may be INFINITE)>
(Must be used in conjunction with actions=)
reboot= <Message broadcast before rebooting on failure>
command= <Command line to be run on failure>
actions= <Failure actions and their delay time (in milliseconds),
separated by/(forward slash) -- e.g., run/5000/reboot/800
Valid actions are <run|restart|reboot> >
(Must be used in conjunction with the reset= option)
您可以包括實際的命令行是您註冊服務。它可能像缺少空間一樣愚蠢 –