VBS启动自定义Firefox窗口和URL

VBS启动自定义Firefox窗口和URL,firefox,vbscript,Firefox,Vbscript,我一直在拼凑一些脚本来启动一个可移植版本的Firefox,其中有一个链接到网络摄像头的URL。我的目标是让2个脚本使用相同的FF.exe,但指向2个不同的URL/IP。我正试图通过删除滚动条、菜单和状态来重新限制浏览器功能,以便只能看到网络摄像头控件和视图 这是当前的代码,但我似乎犯了一个错误,因为现在没有显示URL,只有启动时的默认URL。尺码很合适 dim wshshell FirefoxProfile = "Profile" FirefoxPath = "C:\ADMIN\FF\FF.e

我一直在拼凑一些脚本来启动一个可移植版本的Firefox,其中有一个链接到网络摄像头的URL。我的目标是让2个脚本使用相同的FF.exe,但指向2个不同的URL/IP。我正试图通过删除滚动条、菜单和状态来重新限制浏览器功能,以便只能看到网络摄像头控件和视图

这是当前的代码,但我似乎犯了一个错误,因为现在没有显示URL,只有启动时的默认URL。尺码很合适

dim wshshell

FirefoxProfile = "Profile"
FirefoxPath = "C:\ADMIN\FF\FF.exe"
webappurl = "http://Domain.com"
Height = "870"
Width = "920"

Set wshshell = WScript.CreateObject("WScript.Shell")

wshshell.run """" & FirefoxPath & """ -P """ & FirefoxProfile & """ -Height """ & Height & """ -Width """ & Width & "" & webappurl

Set wshshell = Nothing
wscript.quit
如果您能提供任何帮助或只是朝着正确的方向轻推一下,我们将不胜感激。这是我发现的其他东西,所以可能可以使用,不幸的是,我不认为它本身有任何用处

window.open('Domain.com',null,"height=100px,width=100px,status=0,toolbar=0,menubar=0,location=0");
工作代码:

dim wshshell

Function qq(str)
qq = Chr(34) & str & Chr(34)
End Function

FirefoxProfile = "Profile"
FirefoxPath = "C:\ADMIN\FF\FF.exe"
webappurl = "172.22.111.8"
Height = "700"
Width = "920"
Status ="0"
Toolbar = "0"
Menubar = "0"

Set wshshell = WScript.CreateObject("WScript.Shell")

wshshell.run qq(FirefoxPath) & " -P " & qq(FirefoxProfile) _
& " -status " & qq(status) & " -Toolbar " & qq(toolbar) & " -menubar " & qq(menubar) _
& " -Height " & qq(Height) & " -Width " & qq(Width) _
& " " & webappurl

Set wshshell = Nothing
wscript.quit

我怀疑你的问题就在这里:

wshshell.run ... & """ -Width """ & Width & "" & webappurl
该指令中的最后一个
只是一个空字符串,您可能需要一个结尾双引号,后跟一个空格:

wshshell.run ... & """ -Width """ & Width & """ " & webappurl
我通常建议使用引用函数来避免引用:

Function qq(str)
  qq = Chr(34) & str & Chr(34)
End Function

'...

wshshell.run qq(FirefoxPath) & " -P " & qq(FirefoxProfile) _
  & " -Height " & qq(Height) & " -Width " & qq(Width) _
  & " " & webappurl

非常感谢@Ansgar解决了我的问题,并建议使用报价函数。我有点晕眩。工作脚本现在是为任何正在寻找类似东西的人准备的。我现在唯一的问题是为FF找到正确的开关,除了窗口本身。环顾四周之后,我可能必须找到一个具有完整命令行参数选择的不同浏览器。用代码更新了OP