Automatically Launching Application after Logon

G

Guest

Guest
Archived from groups: microsoft.public.windowsxp.configuration_manage (More info?)

Hi,

The machine in question is in an unsupervised, Kiosk type environement. The
computer is a stand-alone XP pro. It reboots itself once a day. The OS
automatically logs on a user with limited permissions after each reboot. I
have put a shortcut of the application in the Startup folder of the user. So
far, so good...

The problem:
The app that's being auto-launched runs on a local instance of SQL engine
(MSDE). It sometimes happens that the SQL services have not had enough time
to initialize before the App is launched. So it fails.

How can I configure the app to launch after the SQL has initialized?

All I need is about 30 secs. Can I insert a wait period? Can I slave it to
SQL?

Thanks for your input,
 
G

Guest

Guest
Archived from groups: microsoft.public.windowsxp.configuration_manage (More info?)

Give this VBScript a go.

Option Explicit
Dim objWMIService, colRunningServices, objService
Dim oShell
Do While servstate <> "Running"
' msgbox "not running"
Wscript.Sleep 2000
Loop

Function servstate
Set objWMIService = GetObject("winmgmts:" _
& "{impersonationLevel=impersonate}!\\.\root\cimv2")

Set colRunningServices = objWMIService.ExecQuery("Select * " _
& "from Win32_Service Where DisplayName = 'MSSQLSERVER'")

For Each objService in colRunningServices
servstate = objService.State
Next
End Function
Set oShell = CreateObject("Wscript.Shell")
oShell.Run "E:\WINDOWS\system32\calc.exe"

Set objWMIService = Nothing
Set colRunningServices = Nothing
Set oShell = Nothing

(watch for line wrap)

--
Regards,

Dave Patrick ....Please no email replies - reply in newsgroup.
Microsoft Certified Professional
Microsoft MVP [Windows]
http://www.microsoft.com/protect

"Tom Bombadill" wrote:
| Hi,
|
| The machine in question is in an unsupervised, Kiosk type environement.
The
| computer is a stand-alone XP pro. It reboots itself once a day. The OS
| automatically logs on a user with limited permissions after each reboot. I
| have put a shortcut of the application in the Startup folder of the user.
So
| far, so good...
|
| The problem:
| The app that's being auto-launched runs on a local instance of SQL engine
| (MSDE). It sometimes happens that the SQL services have not had enough
time
| to initialize before the App is launched. So it fails.
|
| How can I configure the app to launch after the SQL has initialized?
|
| All I need is about 30 secs. Can I insert a wait period? Can I slave it to
| SQL?
|
| Thanks for your input,
|
|