欢迎光临
我们一直在努力

也许是好东西——Windows Script Host-4[获取当前目录]

建站超值云服务器,限时71元/月

*************************************************
file:   currentdir.vbs (wsh sample in vbscript)
autor:  (c) g. born

retrieving the current directory
*************************************************
option explicit

wscript.echo "script path: ", getpath(), vbcrlf, _
             "current directory: ", currentdir()

wscript.quit   terminate script.

function currentdir
    dim fso
    set fso = wscript.createobject("scripting.filesystemobject")
    currentdir = fso.getabsolutepathname(".")
end function

function getpath
     retrieve path to the script file
    dim path
    path = wscript.scriptfullname   script file name
    getpath = left(path, instrrev(path, "\"))
end function

*** end

赞(0)
版权申明:本站文章部分自网络,如有侵权,请联系:west999com@outlook.com 特别注意:本站所有转载文章言论不代表本站观点! 本站所提供的图片等素材,版权归原作者所有,如需使用,请与原作者联系。未经允许不得转载:IDC资讯中心 » 也许是好东西——Windows Script Host-4[获取当前目录]
分享到: 更多 (0)

相关推荐

  • 暂无文章