Skip to content

Instantly share code, notes, and snippets.

@whaison
Created February 5, 2017 05:01
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save whaison/0f1b4b3438593d7b2a86663973ac1f7b to your computer and use it in GitHub Desktop.
Save whaison/0f1b4b3438593d7b2a86663973ac1f7b to your computer and use it in GitHub Desktop.
ShowWSHInfo_sift_jis_00200_ .vbs
Option Explicit
'---------------------------
'Windows Script Host
'---------------------------
'-----------------------------Print("Hello Windows Script Host")
'WScript.Echo "Hello Windows Script Host"
WScript.Echo "こんにちは ! ウィンドウズ スクリプト ホストさん日本語"
'---------------------------------------------------------------
'-------------------------------------[ファイルに改行付きでデータを書き込む]------http://www.whitire.com/vbs/tips0067.html
On Error Resume Next
'--------------------------------------------------------------
Dim DebugLog___Data
Function DebugLog(strData)
Dim objFSO ' FileSystemObject
Dim objFile ' ファイル書き込み用
Set objFSO = WScript.CreateObject("Scripting.FileSystemObject")
If Err.Number = 0 Then
Set objFile = objFSO.OpenTextFile("ShowWSHInfo_sift_jis_00200____Log.txt", 2, True)
If Err.Number = 0 Then
'objFile.WriteLine("Hello VBScript World 123")
DebugLog___Data=DebugLog___Data + strData + vbCrLf
objFile.WriteLine(DebugLog___Data)
objFile.Close
Else
WScript.Echo "ファイルオープンエラー: " & Err.Description
End If
Else
WScript.Echo "エラー: " & Err.Description
End If
End Function
DebugLog("debug_txt_1")
DebugLog("debug_txt_2")
DebugLog("debug_txt_3")
DebugLog("WSH exe File Name = " + WScript.Name )
DebugLog("WSH exe WScript Full Path = "+ WScript.Path)
DebugLog("WSH version = "+ WScript.Version)
@whaison
Copy link
Author

whaison commented Feb 5, 2017

debug_txt_1
debug_txt_2
debug_txt_3
WSH exe File Name = Windows Script Host
WSH exe WScript Full Path = C:\Windows\System32
WSH version = 5.812

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment