vb应用程序做为系统服务

来源:互联网 发布:js中addeventlistener 编辑:程序博客网 时间:2024/06/07 22:36
1.在windows 9x系统下做为服务
   运行regedit
  HKEY_LOCAL_MACHINE/SOFTWARE/Microsoft/Windows/CurrentVersion/Runserive
 新建reg_sz类型的字符串标题随意,值为要做为服务的程序完整路径名包括文件名和扩展名。
2.在windows nt及 windows 2000下做为服务
Installation:

-> Copy SRVANY.EXE to your system and install it as a Windows NT?service, for example:
    INSTSRV MyService c:/tools/srvany.exe
-> configure via the Services applet ("Startup..." dialog) of the Control Panel as manual or automatic, as appropriate.
-> set via the Services applet ("Startup..." dialog) of the Control Panel the account for the service. If you need access to the screen & keyboard, you must choose the LocalSystem account and click the "Allow Service to Interact with Desktop", otherwise choose any account and specify the correct logon password. Note that the LocalSystem account doesn't have network access.


Specifying the application to start & its parameters:

Run the Registry Editor (REGEDT32.EXE):
-> under HKEY_LOCAL_MACHINE/SYSTEM/CurrentControlSet/Services/MyService: create a 'Parameters' key
-> under the above key, create an 'Application' value of type REG_SZ and specify there the full path of your app executable (including the extension). For example:
     Application: REG_SZ: D:/TOOLS/VI.EXE
 -> OPTIONAL: under the above key, create an 'AppParameters' value of type REG_SZ and specify the parameters for your app. For Example:
    AppParameters: REG_SZ: C:/TMP/FOO
-> OPTIONAL: under the above key, create an 'AppDirectory' value of type REG_SZ and specify the current directory to use for the app, eg:
    AppDirectory: REG_SZ: C:/TMP

The case of all above strings is not important.
原创粉丝点击