分类广告


推荐文章

  • 没有找到任何内容!
您当前的位置:中国站长下载网络编程ASP专区 → 文章内容

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

  • 作者:佚名    来源:不详    发布时间:2005-12-31 13:03:32
  • 字体大小:
'*************************************************
' 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