【转载】将普通应用程序制作成系统服务

来源:互联网 发布:网页js文件 编辑:程序博客网 时间:2024/06/03 08:17

来源:
http://publib.boulder.ibm.com/tividd/td/BSM/SC32-9130-00/en_US/HTML/bsmp112.htm


下载地址:

http://www.microsoft.com/en-us/download/confirmation.aspx?id=17657


User-defined service sample (batch mode)
A batch automatic ticket request processor is not called by Tivoli(R) Business Systems Manager. Therefore, you must provide a mechanism to call it. The batch automatic ticket request processor must run continuously to monitor and process any new batches of input files created by the batch automatic ticket integration function.
If you want to use a user-defined service, follow these steps:
Create a user-defined service on the Tivoli Business Systems Manager database server only. At an MS-DOS command prompt, change to your Resource Kit directory. If your Resource Kit directory is installed on a different drive or in a different directory, change this command accordingly.
cd C:\Program Files\Resource Kit Run the following command to create the service: instsrv.exe ATBatchSrv c:\PROGRA~1\RESOUR~1\srvany.exeYou should receive the following message: The service was successfully added!If you receive the Unable to find the file at the given path. message, then enter where srvany.exe on the command line, and modify the drive and directory as needed.Update the registry with the following steps. Before updating your registry, you should back it up. Open your registry by entering this command: regeditLocate the following subkey in your registry display: HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\ATBatchSrvRight-click the ATBatchSrv subkey, and click New --> Key.Enter the following command: Parameters Right-click the Parameters subkey, and click New --> String Value.Enter the following command: AppDirectoryRight-click the AppDirectory subkey, and click Modify.Enter the following command, where d:\Program Files\Tivoli\tbsm\ is the path where Tivoli Business Systems Manager is installed: d:\Program Files\Tivoli\tbsm\Data\ Right-click the Parameters subkey, and click New --> String Value.Enter the following command: ApplicationRight-click the Application subkey, and click Modify.Enter the following command, where your_language_executable_file is, for example, REXX.exe, SH.exe, or Perl.exe: your_language_executable_fileRight-click the Parameters subkey, and click New --> String Value.Enter the following command: AppParametersRight-click the AppParameters subkey, and click Modify.Enter the following command: name_of_your_automatic_ticket_request_processor Close the registry. You have completed the creation of the ATBatchSrv service.
The ATBatchSvc service is configured to run automatically when the system is restarted; however, you can manually start or stop the ATBatchSvc service.
To delete the service, follow these steps:
Change to the Resource Kit folder. If your Resource Kit folder is installed on a different drive or in a different directory, adjust this command accordingly. cd C:\Program Files\Resource Kit Enter the following command: instsrv.exe ATBatchSvc remove d:\PROGRA~1\RESOUR~1\srvany.exeYou should receive the following message: The service was successfully deleted!
如果在cmd下运行命令的补充知识,来源
http://iask.sina.com.cn/b/4839341.html

1、你知道DOCUME~1是document缩写这就好解释了。
这是因为dos系统的文件名只能容纳8.3位,就是主文件名8位,扩展名3位,中间用.分割。当windows系统的文件名超过了这个长度后它就会自动缩减到前6位字符加波浪号~和1。
2、但为什么后面是~1?,
如果象document这样前8位字符相同的文件名超过一个呢?比如document1、document2、document567?它就会自动加上~2、~3、~4.....如果说它有什么特殊意思,这就是它的特殊意思,也就是说这个~1是dos系统为超过8位的多个文件名自动编的序号。又因为windows里通常只有一个document文件夹,所以一般我们在dos下只能看到DOCUME~1这一个文件名,如果有2个以上它就会显示出DOCUME~2,那样你就不会迷惑了。
这样说你明白吗?
原创粉丝点击