Powered By Blogger
Showing posts with label Registry. Show all posts
Showing posts with label Registry. Show all posts

04 April 2011

Service Path in Windows Registry Key

เมื่้อมีการคลิกขวา
My Computer เลือก Management
แล้วเลือก Services จะเห็น Service ต่างๆ เช่น

Apache Web Server ,  MySQL
และในช่องจะมี  field ชืื่อ path to executable
เช่น
"D:\ms4w\Apache\bin\Apache.exe" -k runservice"


Path เหล่านี้ จากการ Search ใน Google พบว่า
อยู่ที่ Registry

ดัง Link ต่อไปนี้
 http://forum.soft32.com/win3/Changing-Path-Executable-Services-msc-WinXP-SP2-ftopict54633.html

อธิบายได้ว่า

อยู่ที่ Registry Key ที่ตำแหน่ง
HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services

เช่น
Service ชื่อ (Display Name)
Apache Web Server

จะมี Key อยู่ที่ ApacheWebServer
HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\ApacheWebServer
และ จะมี DisplayName= Apache Web Server
และ มี  ImagePath = "D:\ms4w\Apache\bin\Apache.exe" -k runservice

ดูข้อมูลเพิ่มเติมเกี่ยวกับ  Registry  Key นี้  ดังนี้
http://support.microsoft.com/kb/103000


ส่วนในการเขียนโปแกรม ด้วย C# หรือโปรแกรมกลุ่ม .NET Framework เช่น VB.NET
สามารถเข้าถึง Key นี้ได้จาก
Microsoft.Win32.RegistryKey class