页面导航: 首页网络编程JavaScript应用技巧 → 正文内容

Locate a File Using a File Open Dialog Box

发布:dxy 字体:[增加 减小] 类型:转载
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 
浏览次数:载入中... 打印本文关闭本文返回首页

文章评论

共有 位脚本之家网友发表了评论我来说两句

同 类 文 章
最 近 更 新
热 点 排 行