WSCRIPT取得当前执行路径

来源:互联网 发布:c语言32个关键字翻译 编辑:程序博客网 时间:2024/05/05 11:44

test.bat

mode con lines=2000
cscript.exe /x E:/PersonalSet/Desktop/test.vbs
pause

 

 

test.vbs

Dim fso
Set fso = CreateObject("Scripting.FileSystemObject")
StrCurPath = fso.GetFolder(".")
WScript.StdOut.WriteLine StrCurPath

 

-----------------------------------------------------------------------

结果是输出了test.bat所在路径

原创粉丝点击