标题: [问题求助] 用opera调用VBS打开相对路径下的网页的问题 [打印本页]
作者: batsealine 时间: 2013-2-2 01:59 标题: 用opera调用VBS打开相对路径下的网页的问题
本帖最后由 batsealine 于 2013-2-2 10:08 编辑
这是卡饭一牛人写的- Set objShell = CreateObject("Wscript.Shell")
- a = WScript.ScriptFullName
- b = Left(a,Len(a) - Len(WScript.ScriptName))
- Set objHTML=CreateObject("htmlfile")
- c=objHTML.ParentWindow.ClipboardData.GetData("text")
- If c = "1" Then
- c = "皮肤图标查看.mht"
- d = "opera.exe file://localhost/" & b & c
- ElseIf c = "2" Then
- c = "按钮制作工具.mht"
- d = "opera.exe file://localhost/" & b & c
- ElseIf c = "3" Then
- c = "首选项.mht"
- d = "opera.exe file://localhost/" & b & c
- ElseIf c = "4" Then
- c = "web\"
- d = "opera.exe file://localhost/" & b & c
- ElseIf c = "5" Then
- c = "web\"
- d = "C:\Windows\explorer.exe" & " " & b & c
-
- ElseIf c = "6" Then
- c = "fs.html"
- d = "opera.exe file://localhost/" & b & c
-
- ElseIf c = "" Then
- c = "web\"
- d = "opera.exe file://localhost/" & b & c
-
- ElseIf c = "" Then
- c = "profile\"
- d = "C:\Windows\explorer.exe" & " " & b & c
- End If
- objShell.Run d
- 'Set objShell = CreateObject("Wscript.Shell")
- a = WScript.ScriptFullName
- b = Left(a,Len(a) - Len(WScript.ScriptName))
- Set objHTML=CreateObject("htmlfile")
- c=objHTML.ParentWindow.ClipboardData.GetData("text")
- If c = "1" Then
- c = "皮肤图标查看.mht"
- d = "opera.exe file://localhost/" & b & c
- ElseIf c = "2" Then
- c = "按钮制作工具.mht"
- d = "opera.exe file://localhost/" & b & c
- ElseIf c = "3" Then
- c = "首选项.mht"
- d = "opera.exe file://localhost/" & b & c
- ElseIf c = "4" Then
- c = "web\"
- d = "opera.exe file://localhost/" & b & c
- ElseIf c = "5" Then
- c = "web\"
- d = "C:\Windows\explorer.exe" & " " & b & c
-
- ElseIf c = "6" Then
- c = "seam\fs.html"
- d = "opera.exe file://localhost/" & b & c
-
- ElseIf c = "" Then
- c = "web\"
- d = "opera.exe file://localhost/" & b & c
-
- ElseIf c = "" Then
- c = "profile\"
- d = "C:\Windows\explorer.exe" & " " & b & c
-
- End If
- objShell.Run d
- '其中的文件和文件夹与VBS在同一目录
复制代码
调用它的opera命令为- Focus address field & Clear & Insert, "4" & Delay, 10 & Select all & Cut & Execute program, "optools\document.vbs"
- 命令解释: 聚焦地址栏 & 清空 & 输入4 & 延迟10 & 选中4 & 剪切 & 调用VBS
- 结果: 在新标签中打开web文件夹(为何会在新标签中打开有点费解,因为若直接复制全路径再enter是在当前标签打开)
复制代码
问题: 每次运行命令后剪贴板里的东西会改变,希望有高手能将其改进,让opera直接传递参数给VBS,其格式为Execute program, "程序路径以及程序名", "参数"。不过要是VBS不能接收opera参数,我希望先 Execute program, "optools\document_start\1.vbs",再用1.vbs调用document.vbs打开第一个选项即“皮肤图标查看.mht”
作者: Demon 时间: 2013-2-2 09:39
http://bbs.kafan.cn/thread-1370407-1-1.html
连命令行参数都不会用,果然是牛人
欢迎光临 批处理之家 (http://www.bathome.net/) |
Powered by Discuz! 7.2 |