WSCRIPT取得当前执行路径

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所在路径

posted @ 2010-06-27 09:43  dzqabc  阅读(451)  评论(0编辑  收藏  举报