'*************************************************
' 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
' 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
相关信息
- 关于本站 - 网站帮助 - 广告合作 - 下载声明 - 友情连接 - 网站地图 - 管理登陆
- Copyright © 2003-2007 ZhuYe123.COM. All Rights Reserved . 粤ICP备05072659号
- 致力于中国个人网站发展,我们一直在努力!