Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

twapi create_service procedure trouble

Status
Not open for further replies.

clkanski

Technical User
Jan 13, 2005
5
US
I'm trying to create a service with the twapi procedure create_service. I am using a simple .bat file as the COMMAND, but whenever I start the service I get

Error # 1053 The service did not respond to the start or control request in a timely fashion.

Has anyone had any luck using this procedure? Is it my choice of Command? I figured I'd start simple and expand it to my intended application when I could get this working.

I am using the 0.5 twapi extensions with tcl 8.4 and Windows XP Pro.

I also tried installing the service with a C++ app, but it results in the same error.
 
Yeah, I've had some similar problems.
Try posting to comp.lang.tcl and see if anyone has an
example of a working twapi service insertion using any
tcl called process/procedure is my best advice.
 
I was told about the generic service installer that comes with the NT Resource Kit. It is called srvany.exe, and the installer, called instsrv.exe. This was able to run my script without any problems. Thanks to PatrickF for the help. Here is what he told me:

I run serveral tcl scripts as services. For example to run the check
memory tcl script in the backround as a service:


1. Copy srvany.exe from the NT resource kit to c:\winnt\system32.


2. execute instsrv CHECKMEM c:\winnt\system32\srvany.exe. This
installs the CHECKMEM service running under srvany.


3. Edit the CHECKMEM service via control panel and select "allow
interactivity with desktop". Service should run under the local system
account.


4. Modify the registry using REGEDIT32 by either


navigating to
HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\CHECKMEM.
Under CHECKMEM create a key called "Parameters".
Under Parameters create a string value called "Application" with the
value cmd.exe /c tclsh D:\scripts\Tcl\notify\checkMem.tcl.


Save changes.


OR


create a file with the following entry and import into the registry.


Windows Registry Editor Version 5.00
[HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\CHECKMEM\Parameters]
"Application"="cmd /c tclsh D:\\scripts\\TCL\\notify\\checkMem.tcl"


NB: Ensure your script works without errors before you create it as a
service. Test it from the command line. E.G tclsh
D:\\scripts\\TCL\\notify\\checkMem.tcl.


The CheckMem source is located at:
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top