VBS/現在のフォルダを取得する
VBSでカレントフォルダを取得します。
【引用元URL】http://www.whitire.com/vbs/tips0118.html
【ソースコード】
Option Explicit On Error Resume Next Dim objWshShell ' WshShell オブジェクト Set objWshShell = WScript.CreateObject("WScript.Shell") If Err.Number = 0 Then WScript.Echo "現在のフォルダは " & objWshShell.CurrentDirectory & " です。" Else WScript.Echo "エラー: " & Err.Description End If Set objWshShell = Nothing
【実行結果】
C:\Temp> cscript //NoLogo tips0118.vbs 現在のフォルダは C:\Temp です。
このページのURL: