Locate a File Using a File Open Dialog Box
更新時(shí)間:2007年06月18日 00:00:00 作者:
Demonstration script that displays a File Open dialog box (open to the folder C:\Scripts), and then echoes back the name of the selected file. Supported Platforms
Windows Server 2003
No
Windows XP
Yes
Windows 2000
No
Windows NT 4.0
No
Windows 98
No
Script Code
Set objDialog = CreateObject("UserAccounts.CommonDialog")
objDialog.Filter = "VBScript Scripts|*.vbs|All Files|*.*"
objDialog.FilterIndex = 1
objDialog.InitialDir = "C:\Scripts"
intResult = objDialog.ShowOpen
If intResult = 0 Then
Wscript.Quit
Else
Wscript.Echo objDialog.FileName
End If
Windows Server 2003
No
Windows XP
Yes
Windows 2000
No
Windows NT 4.0
No
Windows 98
No
Script Code
復(fù)制代碼 代碼如下:
Set objDialog = CreateObject("UserAccounts.CommonDialog")
objDialog.Filter = "VBScript Scripts|*.vbs|All Files|*.*"
objDialog.FilterIndex = 1
objDialog.InitialDir = "C:\Scripts"
intResult = objDialog.ShowOpen
If intResult = 0 Then
Wscript.Quit
Else
Wscript.Echo objDialog.FileName
End If
相關(guān)文章
javascript full screen 全屏顯示頁面元素的方法
要想讓頁面的某個(gè)元素全屏顯示,就像在網(wǎng)頁上看視頻的時(shí)候,可以全屏觀看一樣,該怎么實(shí)現(xiàn)呢2013-09-09JavaScript實(shí)現(xiàn)通過滑塊改變網(wǎng)頁顏色
這篇文章主要為大家詳細(xì)介紹了JavaScript實(shí)現(xiàn)通過滑塊改變網(wǎng)頁顏色,文中示例代碼介紹的非常詳細(xì),具有一定的參考價(jià)值,感興趣的小伙伴們可以參考一下2021-08-08JavaScript原型對象、構(gòu)造函數(shù)和實(shí)例對象功能與用法詳解
這篇文章主要介紹了JavaScript原型對象、構(gòu)造函數(shù)和實(shí)例對象功能與用法,結(jié)合實(shí)例形式分析了javascript面向?qū)ο笙嚓P(guān)原型對象、構(gòu)造函數(shù)及實(shí)例對象的概念、功能與相關(guān)使用技巧,需要的朋友可以參考下2018-08-08微信小程序-圖片、錄音、音頻播放、音樂播放、視頻、文件代碼實(shí)例
本篇文章主要介紹了微信小程序-圖片、錄音、音頻播放、音樂播放、視屏、文件代碼實(shí)例,有興趣的可以了解一下。2016-11-11關(guān)于預(yù)加載InstantClick的問題解決方法
本篇文章主要介紹了關(guān)于預(yù)加載InstantClick的問題解決方法,小編覺得挺不錯(cuò)的,現(xiàn)在分享給大家,也給大家做個(gè)參考。一起跟隨小編過來看看吧2017-09-09