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 Shaun E on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Running programs in the background

Status
Not open for further replies.

mbutch

Programmer
Nov 17, 2000
100
US
Is there an easier way to run programs in the background using Win2000? I need to run a program called TimeWolf all the time regardless of who ,if anyone, is logged in. I need to run it under a certain login and I don't want anyone else to be able to access it while using this machine. TimeWolf itself has its own user name and pass. I've tried using the run as feature, but I can't pass the login to TimeWolf. I wrote a script using WinBatch that opens TimeWolf and logs in. I just set the script to run under a specififc login, which would make TimeWolf open under the same login. If I try to close TimeWolf in the task manager under a different login I get an error, which is good. When I log off, TimeWolf no longer works for some reason. I tried setting the scheduler to run the script every time someone logs in, but it doesn't work. It says TimeWolf is open on the task manager, but it isn't doing anything because there is a file on the network TimeWolf is supposed to be updating, but its not getting updated. Any suggestions?
 
There used to be a utility in the NT4 Resource kit which allowed you to run any program as a service. Is there one in the 2000 Resource kit too ?

This would allow your app to run independant of logins. Ian

"IF" is not a word it's a way of life
 
Someone had a similar question a while back and there seemed to be a good response so I copied it....
Here it is:
You need two files from the Windows NT server resource kit.
INSTSRV.EXE
SVRANY.EXE
Copy these files to %WINDIR%\system32
then goto start\run and type in this command

Instsrv xyz c:\winnt\system32\srvany.exe
This creates a service called xyz(you can name it anything)

Then goto regedit:
HKEY_LOCAL_MACHINE\SYSTEM\CurrentControllSet\Services\xyz
Create a key called Parameters
Open Parameters and create these three string values there:
AppDirectory "c:\xyz" (the path to your program dir)
Application "c:\xyz\xyz.exe" (the path to the app exe)
AppParameters "/???" (only if startup-parameters are needed)

If you don't have the resource kit just email me and I will email them to you. They are very small.

BobSchleicher


The name above is the guy who provided the info.
Hope this helps.

Jeremy
 
Thanks for the copy. I just have a couple questions. Would the service still run if whoever logged in didn't have access to a certain network drive that the program required to run? While its running as a service can I send commands to it through a script? How would I log into TimeWolf when it started up as a service?
 
Q1 - When run as a service the OS runs it with a defined set of permissions, so it is independant of who logs in when.
Q2 - Don't know, I suppose it would depend on the app, but since you wouldn't be the "owner" of the process I'd guess that you wouldn't be able to.
Q3 - You wouldn't be able to log into a process running as a service unless it is written to allow you to. You can stop & start services, get them to stop and start at defined points, but I don't know about interacting with a running currently service.

Without knowing a thing about TimeWolf, what it does, how or why, the questions that you are asking suggest that maybe running as a service are not applicable in this case. But I can't think of another easy way of running apps independant of login. Ian

"IF" is not a word it's a way of life
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top