ソース掲示板




すべてから検索

キーワード   条件 表示 現行ログ 過去ログ トピックス 名前 本文
PHPの 「開発始めますよ。」スクリプト ( No.0 )
日時: 2009/02/21 18:44
名前: lightbox



拡張子:
1) httpd.exe がプロセスに無かったら起動
2) MySQL51 が サービス開始してなかったら開始
3) 通常使うディリクトリをエクスプローラで開く
4) その場所を IE から開く
拡張子:
' **********************************************************
' アプリケーション起動用
' **********************************************************
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 )