判斷文件並執行這個文件

<script
 language="vbscript">

sub
 datacheck()

    if

func_FileExist("C:\Program
 Files\easylogic\oa.elc")=true

then

        Dim
 WshShell

        Set
 WshShell =  CreateObject("WScript.Shell")

        WshShell.Run
"""C:\Program  www.aiwalls.com
 Files\easylogic\oa.elc"""

        Set
 WshShell  =  Nothing

    else

        window.location.href
"../erpLoginCheck.htm?ReturnUrl="

+ window.location.href

        exit
 sub

    end
if

end
 sub

 

Function
 func_FileExist(strFilePath)

    set
 oFSO = createObject("Scripting.FileSystemObject")

    boolFileExists
 = oFSO.fileExists(strFilePath)

    set
 oFSO = Nothing

    func_FileExist
 = boolFileExists

End
 Function

</script>

描述:利用VBscript判斷指定的文件是否存在,如果不存在則跳到下載頁面,如果存在則直接打開
作者:WuWenji_ZhaoLinQing
 

發佈留言

發佈留言必須填寫的電子郵件地址不會公開。 必填欄位標示為 *