vbs実行ファイルのパスを取得

cmdの実行パス
test = createobject(“Scripting.FileSystemObject").GetFolder(“.").Path
Wscript.echo test

VBSの実行パス

strComputer = “."
Set objWMIService = GetObject(“winmgmts:\\" & strComputer & “\root\cimv2")
Set colItems = objWMIService.ExecQuery(“Select * From Win32_Process Where Name = 'wscript.exe’ OR Name = 'cscript.exe'")
For Each objItem in colItems
lmq=lmq & objItem.CommandLine & vbcrlf
Next
Wscript.Echo lmq

Source

Posted by arkgame