' **********************************************************' アプリケーション起動用' **********************************************************
Set WshShell = Wscript.CreateObject( "WScript.Shell" )
' **********************************************************' プロセス( httpd.exe )' **********************************************************
Set objWMIService = _
GetObject("winmgmts:{impersonationLevel=impersonate}!\\.\root\cimv2")
Set colProcesses = _
objWMIService.ExecQuery("Select * from Win32_Process Where Name = 'httpd.exe'")
flg = false
For Each objProcess in colProcesses
flg = true
Next
if Not flg then
WshShell.CurrentDirectory = "C:\httpd"
WshShell.Run( "httpd.exe" )
end if
' **********************************************************' サービス( MySQL51 )' **********************************************************
Set colRunningServices = _
objWMIService.ExecQuery("Select * from Win32_Service Where DisplayName = 'MySQL51'")
For Each objService in colRunningServices
if objService.State = "Stopped" then
objService.StartService()
end if
Next
' **********************************************************' httpd.exe のエイリアスをエクスプローラで開く' **********************************************************
str = "explorer.exe /e,C:\Documents and Settings\lightbox\My Documents\__test"
WshShell.Run( str )
' **********************************************************' httpd.exe のエイリアスを IE で開く' **********************************************************
str = "iexplore.exe http" & "://localhost/phptest"
WshShell.Run( str )