2017-12-20 13 views
1

私たちの環境では、バックグラウンドでウェブサイトを開く必要があります。ユーザーは何も気づかないでください。バックグラウンドでウェブサイトを開く

私は、次のPowerShellのコマンドを使用して、それを試してみたが、それが動作していない:

Start-Process -WindowStyle Hidden "C:\Program Files\Internet Explorer\iexplore.exe" "www.google.com" 

オペレーティングシステムは、Windows 10エンタープライズLTSBです。 他に解決策はありますか?

ありがとうございます!勝利の框用

+0

は誤りがありません。 Internet Explorerはgoogle.comで開始されますが、バックグラウンドでは開始されません。 –

答えて

0

は、Google Chromeのポータブル、次のAutoItスクリプトを経由して、それを実現:

#include <Constants.au3> 

_Start_Minimized_Chrome() 

Func _Start_Minimized_Chrome() 

Local $chrome = ShellExecute("C:\chrome\GoogleChromePortable.exe", '"https://website.com"') 

WinWait("[CLASS:Firefox_WidgetWin_1]", "") 
Local $WinList = WinList() 
For $i = 1 To $WinList[0][0] 
    If $WinList[$i][0] <> "" And StringInStr($WinList[$i][0], " - Mozilla Firefox", 1) Then WinSetState($WinList[$i][1], "", @SW_HIDE) 
    Next 
EndFunc ;==>_Start_Minimized_Chrome 
1

使用最小化:

Start-Process -WindowStyle Minimized "C:\Program Files\Internet Explorer\iexplore.exe" "www.google.com" 

バックグラウンド・プロセスとしてのWebサイトを開くためのポイントは何ですか。それは非常に悪い建築です。

+0

どちらも動作しません。 ieウィンドウがポップアップします。 –

+0

'-WindowStyle Hidden'? – stuartd

+0

私たちはリストデータからqrコードを生成し、これをdymoラベルライタプリンタに送るカスタムsharepointサイトを持っています。 URLを介してspサイトに埋め込まれたjsコードにデータを渡します。これはバックグラウンドで発生するはずです。 –

0

これは、最小化したウィンドウを開きます:

$browserurl = 'https://stackoverflow.com/questions/47908413/open-a-website-in-background' 
$p = [System.Diagnostics.Process]::new() 
$P.StartInfo.Arguments = [string]::Format("{0}{1}", "-nomerge ", $browserurl) 
$P.StartInfo.WindowStyle = [System.Diagnostics.ProcessWindowStyle]::Minimized 
$P.StartInfo.CreateNoWindow = $true 
$P.StartInfo.UseShellExecute = $true 
$P.StartInfo.FileName = "iexplore.exe" 
$P.Start() 

私はそれはIEのCOMオブジェクトでの作業への別のリンクを持っている。これC#のポストからこのコードを得ました。 Opening a Hidden Internet Explorer Window without it getting Focus?

+0

それは働くことができません。 :( –

関連する問題