teratail header banner
teratail header banner
質問するログイン新規登録

回答編集履歴

1

tuiki

2021/07/01 04:26

投稿

yambejp
yambejp

スコア117867

answer CHANGED
@@ -11,4 +11,25 @@
11
11
  実行
12
12
  ```
13
13
  wscript test.vbs
14
+ ```
15
+ # 追記
16
+ IEが開いていたらそちらを利用する
17
+ ```VBScript
18
+ Dim ie
19
+ set ie=Nothing
20
+ Dim obj
21
+ For Each obj In CreateObject("Shell.Application").Windows
22
+ If TypeName(obj.Document) = "HTMLDocument" Then
23
+ Set ie = obj
24
+ Exit For
25
+ End If
26
+ Next
27
+ If ie Is Nothing Then
28
+ Set ie = CreateObject("InternetExplorer.Application")
29
+ end if
30
+ ie.Visible = True
31
+ ie.navigate2 "https://www.google.com"
32
+ wscript.sleep 3000
33
+ ie.navigate2 "https://www.yahoo.co.jp"
34
+
14
35
  ```