L_Welcome_MsgBox_Message_Text = "このスクリプトはこのコンピュータで定義されているすべての環境変数を一覧表示します。" L_Welcome_MsgBox_Title_Text = "Windows スクリプティング ホスト サンプル" Call Welcome() CRLF = Chr(13) & Chr(10) Dim WSHShell Set WSHShell = WScript.CreateObject("WScript.Shell") Sub show_env(strText) MsgBox strText, vbInformation, L_Welcome_MsgBox_Title_Text End Sub intIndex = 0 strText = "" intNumEnv = 0 MAX_ENV = 20 For Each strEnv In WshShell.Environment("PROCESS") intIndex = intIndex + 1 strText = strText & CRLF & Right(" " & intIndex, 4) & " " & strEnv intNumEnv = intNumEnv + 1 If intNumEnv >= MAX_ENV Then Call show_env(strText) strText = "" intNumEnv = 0 End If Next If intNumEnv >= 1 Then Call show_env(strText) ' ******************************************************************************** ' * ' * Welcome ' * Sub Welcome() Dim intDoIt intDoIt = MsgBox(L_Welcome_MsgBox_Message_Text, _ vbOKCancel + vbInformation, _ L_Welcome_MsgBox_Title_Text ) If intDoIt = vbCancel Then WScript.Quit End If End Sub