Internet explorer 在没有工具栏的新进程中启动Internet Explorer 7

Internet explorer 在没有工具栏的新进程中启动Internet Explorer 7,internet-explorer,vbscript,Internet Explorer,Vbscript,我需要在IE中运行一个web应用程序,这样它至少看起来类似于一个独立的应用程序。我还需要能够在不同的会话中同时运行此web应用程序的多个实例 为了实现这种效果,我希望总是在一个新的进程中启动InternetExplorer7,而不需要从桌面上的快捷方式启动工具栏/状态栏 我试过一些方法。到目前为止,我找到的壁橱正在创建以下vb脚本的快捷方式 Set objExplorer = CreateObject("InternetExplorer.Application") objExplorer.Nav

我需要在IE中运行一个web应用程序,这样它至少看起来类似于一个独立的应用程序。我还需要能够在不同的会话中同时运行此web应用程序的多个实例

为了实现这种效果,我希望总是在一个新的进程中启动InternetExplorer7,而不需要从桌面上的快捷方式启动工具栏/状态栏

我试过一些方法。到目前为止,我找到的壁橱正在创建以下vb脚本的快捷方式

Set objExplorer = CreateObject("InternetExplorer.Application")
objExplorer.Navigate "http://stackoverflow.com"
objExplorer.ToolBar = 0
objExplorer.StatusBar = 0
objExplorer.Width = 1024
objExplorer.Height = 768
objExplorer.Left = 0
objExplorer.Top = 0
objExplorer.Visible = 1
这看起来和我想要的一模一样。但是,如果再次双击快捷方式,它会打开一个新窗口,但在同一进程内,即Windows任务管理器中只有一个iexplore.exe进程。由于两个实例位于同一进程内,因此它们共享同一会话。因此,如果您登录到该应用程序的一个实例,那么您就登录到该应用程序的另一个实例,这对我没有好处

我也试过,

"Program Files\Internet Explorer\iexplore.exe" http://stackoverflow.com
它总是启动一个新进程,但不能仅删除工具栏/状态栏。Kiosk模式-k参数对我没有好处,因为我需要它出现在窗口中

有人能告诉我如何在没有工具栏/状态栏的情况下,通过桌面上的快捷方式始终在新进程中启动Internet Explorer 7吗

我对解决方案的任何技术都持开放态度

谢谢,
Everett

您可以使用如下HTML应用程序:

<html>
<head>
<title>Stack Overflow</title>
<hta:application showintaskbar="yes" singleinstance="no" sysmenu="yes" scroll="no"
icon="http://www.stackoverflow.com/favicon.ico">
<style type="text/css">
* { margin: 0px; padding: 0px; }
iframe { position: absolute; top: 0px; left: 0px; width: 100%; height: 100%; }
</style>
</head>
<body>
<IFRAME SRC="http://www.stackoverflow.com/" APPLICATION="no">
</body>
</html>

但是,如果没有针对HTA的特殊预防措施,这往往会弄乱其中任何页面的JS。

您可以使用如下HTML应用程序:

<html>
<head>
<title>Stack Overflow</title>
<hta:application showintaskbar="yes" singleinstance="no" sysmenu="yes" scroll="no"
icon="http://www.stackoverflow.com/favicon.ico">
<style type="text/css">
* { margin: 0px; padding: 0px; }
iframe { position: absolute; top: 0px; left: 0px; width: 100%; height: 100%; }
</style>
</head>
<body>
<IFRAME SRC="http://www.stackoverflow.com/" APPLICATION="no">
</body>
</html>

但是,如果没有针对HTA的特别预防措施,这往往会弄乱其中任何页面的JS。

您可以通过操纵IE COM服务器来做到这一点。在powershell中很容易做到:

$ie = new-object -COM InternetExplorer.Application
$ie.ToolBar = $false
$ie.StatusBar = $false
$ie.Navigate2( "http://www.stackoverflow.com" )
$ie.Visible = $true
如果在ie-app.ps1中,那么您的快捷方式将使用powershell-command ie-app.ps1来调用它


这与在vbscript中使用Windows脚本主机所做的基本相同。您可以使用任何可以操纵InternetExplorer.Application COM对象的东西。我有IE8,这可能只是IE7和IE8之间的区别,但以我的powershell为例,我有两个进程。

您可以通过操纵IE COM服务器来实现这一点。在powershell中很容易做到:

$ie = new-object -COM InternetExplorer.Application
$ie.ToolBar = $false
$ie.StatusBar = $false
$ie.Navigate2( "http://www.stackoverflow.com" )
$ie.Visible = $true
如果在ie-app.ps1中,那么您的快捷方式将使用powershell-command ie-app.ps1来调用它


这与在vbscript中使用Windows脚本主机所做的基本相同。您可以使用任何可以操纵InternetExplorer.Application COM对象的东西。我有IE8,这可能只是IE7和IE8之间的区别,但以我的powershell为例,我有两个进程。

您没有指定要使用什么编码机制来实现这一点,但毫无疑问,您会希望查看它。

您没有指定要使用什么编码机制来实现这一点,但毫无疑问,你会想研究。

其他答案都不适合我,所以这里是一个我从各种来源拼凑而成的vb脚本,我不是一个vb脚本编写者

On Error Resume Next

AppURL = "http://www.stackoverflow.com"
AppToRun = "iexplore about:blank"
AboutBlankTitle = "Blank Page"
LoadingMessage = "Loading stackoverflow..."
ErrorMessage = "An error occurred while loading stackoverflow.  Please close the Internet Explorer with Blank Page and try again.  If the problem continues please contact IT."
EmptyTitle = ""

'Launch Internet Explorer in a separate process as a minimized window so we don't see the toolbars disappearing
dim WshShell
set WshShell = WScript.CreateObject("WScript.Shell")
WshShell.Run AppToRun, 6

dim objShell
dim objShellWindows

set objShell = CreateObject("Shell.Application")
set objShellWindows = objShell.Windows

dim ieStarted
ieStarted = false

dim ieError
ieError = false

dim seconds
seconds = 0

while (not ieStarted) and (not ieError) and (seconds < 30)

    if (not objShellWindows is nothing) then
        dim objIE
        dim IE

        'For each IE object
        for each objIE in objShellWindows

            if (not objIE is nothing) then

                if isObject(objIE.Document) then
                    set IE = objIE.Document

                    'For each IE object that isn't an activex control
                    if VarType(IE) = 8 then

                        if IE.title = EmptyTitle then
                            if Err.Number = 0 then
                                IE.Write LoadingMessage

                                objIE.ToolBar = 0
                                objIE.StatusBar = 1
                                objIE.Navigate2 AppURL

                                ieStarted = true
                            else
                                'To see the full error comment out On Error Resume Next on line 1
                                MsgBox ErrorMessage
                                Err.Clear

                                ieError = true

                                Exit For
                            end if
                        end if
                    end if
                end if
            end if

            set IE = nothing
            set objIE = nothing
        Next
    end if

    WScript.sleep 1000
    seconds = seconds + 1
wend

set objShellWindows = nothing
set objShell = nothing

'Activate the IE window and restore it
success = WshShell.AppActivate(AboutBlankTitle)

if success then 
    WshShell.sendkeys "% r"  'restore 
end if

我愿意接受任何改进或建议。

其他答案都不适合我,因此这是一个我从各种来源拼凑而成的vb脚本,我不是vb脚本编写者

On Error Resume Next

AppURL = "http://www.stackoverflow.com"
AppToRun = "iexplore about:blank"
AboutBlankTitle = "Blank Page"
LoadingMessage = "Loading stackoverflow..."
ErrorMessage = "An error occurred while loading stackoverflow.  Please close the Internet Explorer with Blank Page and try again.  If the problem continues please contact IT."
EmptyTitle = ""

'Launch Internet Explorer in a separate process as a minimized window so we don't see the toolbars disappearing
dim WshShell
set WshShell = WScript.CreateObject("WScript.Shell")
WshShell.Run AppToRun, 6

dim objShell
dim objShellWindows

set objShell = CreateObject("Shell.Application")
set objShellWindows = objShell.Windows

dim ieStarted
ieStarted = false

dim ieError
ieError = false

dim seconds
seconds = 0

while (not ieStarted) and (not ieError) and (seconds < 30)

    if (not objShellWindows is nothing) then
        dim objIE
        dim IE

        'For each IE object
        for each objIE in objShellWindows

            if (not objIE is nothing) then

                if isObject(objIE.Document) then
                    set IE = objIE.Document

                    'For each IE object that isn't an activex control
                    if VarType(IE) = 8 then

                        if IE.title = EmptyTitle then
                            if Err.Number = 0 then
                                IE.Write LoadingMessage

                                objIE.ToolBar = 0
                                objIE.StatusBar = 1
                                objIE.Navigate2 AppURL

                                ieStarted = true
                            else
                                'To see the full error comment out On Error Resume Next on line 1
                                MsgBox ErrorMessage
                                Err.Clear

                                ieError = true

                                Exit For
                            end if
                        end if
                    end if
                end if
            end if

            set IE = nothing
            set objIE = nothing
        Next
    end if

    WScript.sleep 1000
    seconds = seconds + 1
wend

set objShellWindows = nothing
set objShell = nothing

'Activate the IE window and restore it
success = WshShell.AppActivate(AboutBlankTitle)

if success then 
    WshShell.sendkeys "% r"  'restore 
end if

我愿意接受任何改进或建议。

我没有指定技术,因为我愿意接受任何解决方案编辑的帖子。我没有指定技术,因为我愿意接受任何解决方案编辑的帖子。感谢您的建议,但当我尝试使用Windows XP和IE7时,我仍然只得到一个进程。感谢您的建议,但当我尝试此操作时对于Windows XP和IE7,我仍然只有一个进程。感谢您的建议,但当我尝试此操作时,我的页面上的JavaScript出现了问题,其中大部分我甚至无法触摸。感谢您的建议,但当我尝试此操作时,我的页面上的JavaScript出现了问题,其中大部分我甚至无法触摸。