在windows2003中将程序做成windows服务

After intalling the windows resource kits(rktool.exe)

Step 1: C:\Program Files\Windows Resource Kits\Tools>instsrv.exe pdfcreatorService "C:\Program Files\Windows Resource Kits\Tools\srvany.exe"

Step 2: goto start->run->regedit->HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\pdfcreatorService

Step 3: right click pdfcreatorService, new->key name is Parameters

Step 4: goto Parameters,new->String value name is Application, value is C:\Program Files\PDFCreator\PDFCreator.exe
new->String name is AppDirectory value is C:\Program Files\PDFCreator

Step 5: Then is ok. goto services manager window, start the service 'pdfcreatorService '










REFERENCE:

C:\Program Files\Windows Resource Kits\Tools>instsrv.exe pdfcreatorService "C:\Program Files\Windows Resource Kits\Tools\srvany.exe"


INSTSRV <service name> (<exe location> | REMOVE)
  [-a <Account Name>] [-p <Account Password>]

  Install service example:

    INSTSRV MyService C:\MyDir\DiskService.Exe
    -OR-
    INSTSRV MyService C:\mailsrv\mailsrv.exe -a MYDOMAIN\joebob -p foo

  Remove service example:

    INSTSRV MyService REMOVE

你可能感兴趣的:(C++,c,windows,C#)