安大互联
财经热点 > Asp编程 > 也许是好东西——Windows Script Host-4[获取当前目录]
【问题文章】也许是好东西——Windows Script Host-4[获取当前目录]
浏览次数:【11】  发布日期:2009-8-13 12:09:22    文章分类:Asp编程   
专题:问题文章】 【
 
'*************************************************
' 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

手机扫码浏览该文章
 ● 相关资讯推荐
 ● 相关资讯专题
  • 网络建设业务咨询

   TEl:13626712526