[tips0006.vbs] Option Explicit Dim strFolderName ' フォルダ名 Dim strScriptName ' スクリプト名 strScriptName = WScript.ScriptName strFolderName = Left(WScript.ScriptFullName, _ InStrRev(WScript.ScriptFullName, "\")) WScript.Echo "フォルダ名:" & strFolderName WScript.Echo "スクリプト名:" & strScriptName
C:\> cscript //NoLogo tips0006.vbs フォルダ名:C:\temp\ スクリプト名:tips0006.vbs