Discussion Locked

Create timer to run app after W2K loads

0 helpful
6 replies
Closed to new repliesThis discussion is closed. It stays readable, but it takes no new replies.

We are migrating to W2K and have an application that causes the "Spoolsv.exe has generated errors and will be shut down. You will need to restart the application." on bootup. Pulling the application out of the start folder prevents the problem. However, we need to have the application autoload. Starting the application a minute after W2K finishes loading works fine.
My thought is to create a countdown timer and put it in the startup folder or the registry "Run" key, that will count a predetermined amount of time and then run the application a minute or so after W2K loads. I haven't found any information on how to accomplish this on Microsoft's site or here. Any help would be appreciated.

6 replies

by estebandelatorre

A "TIMER" IS INCLUDED IN THE WIN2KS SERVICE MANAGER, SO, GO TO YOUR SERVICE MANAGER, SELECT THE SERVICE, VIEW IT'S PROPERTIES, SELECT THE "RECUPERATION TAB" (IS OK THE NAME??, I HAVE IT IN SPANISH!!), AND CHANGE IN THE "FIRST ERROR" DROP DOWN COMBO, AND CHOOSE "RESTART SERVICE", AND ALSO CHANGE THE "START SERVICE IN XX MINUTES" TO MATCH YOUR NEEDS.

HOPE IT HELPS!!!

by k_pestrue

What I need to start is an application and not a service, I don't have the option to start it as a service. Thanks anyway

by baziite

I am not familiar with win2k but i am making a calculated guess that if it is possible to move the app to the last position in the startup app order then your problem will be solved . we had a AT command in win NT with you could also include in the login script inorder to schedule application startup at a time based on current time plus a few minutes .

Try it may be it works

Good luck

by k_pestrue

I need to start the application about 30 seconds after w2k finishes loading to ensure that everything is done. Putting it last in the startup order would not give me enough time. Thanks anyway

by k_pestrue

I solved the problem by creating a VB-WSH script that kicks off a 45 second timer, then goes to the application and creates a shortcut, and then runs the shortcut. I've included the code here because I haven't seen anything like it anywhere, I hopeit helps someone.
'Delays executatuion of the application.
Dim DelayTime, Start, Finish
DelayTime = 45 ' Set duration in seconds.
Start = Timer ' Set start time.
Do While Timer < Start + DelayTime
Loop
Finish = Timer ' Set end time.

'creates a shortcut to an application.
Dim WSHShell
Dim MyApp
Set WSHShell = WScript.CreateObject("WScript.Shell")

AppPath = WSHShell.ExpandEnvironmentStrings("C:\Program Files\Aventail\AutoSOCKS")

Set MyApp = WSHShell.CreateShortcut(AppPath & "\AutoSocks.lnk")' Create a shortcut object

' Sets shortcut object properties and saves it
MyApp.TargetPath = WSHShell.ExpandEnvironmentStrings("C:\Program Files\Aventail\AutoSOCKS\AS32.EXE")
MyApp.WorkingDirectory = WSHShell.ExpandEnvironmentStrings("C:\Program Files\Aventail\AutoSOCKS")
MyApp.WindowStyle = 4
MyApp.IconLocation = WSHShell.ExpandEnvironmentStrings("C:\Program Files\Aventail\AutoSOCKS")', 0")
MyApp.Save

' Runs the programWSHShell.Run ("Autosocks " & MyApp.WorkingDirectory) 'Need space after app name

This discussion is closed to new replies.