Getting current directory in VBScript

后端 未结 7 2393
天命终不由人
天命终不由人 2020-11-29 02:45

I\'m trying to get the current directory and use it to run an application no matter where the file is put and no matter how the path is changed

Dim fso: set          


        
7条回答
  •  长情又很酷
    2020-11-29 03:17

    You can use CurrentDirectory property.

    Dim WshShell, strCurDir
    Set WshShell = CreateObject("WScript.Shell")
    strCurDir    = WshShell.CurrentDirectory
    WshShell.Run strCurDir & "\attribute.exe", 0
    Set WshShell = Nothing
    

提交回复
热议问题