hiko-blog

VBA業務改善

MENU

バッチで自動立ち上げ

''vbs------------

' Create Internet Explorer Object
Set IE = CreateObject("InternetExplorer.Application")

' Set visibility to true to make it visible, false to hide it
IE.Visible = True

' Navigate to the specified webpage
IE.Navigate "https://www.example.com" ' ここに指定のページのURLを入力します

' Loop until the page is fully loaded
Do While IE.Busy
    WScript.Sleep 100
Loop

' Close the Internet Explorer object
IE.Quit

 

''bat---------------

@echo off
REM 起動する時間を指定します(24時間形式)
set target_time=12:00

REM 現在の時間を取得します
for /f "tokens=1-2 delims=:" %%a in ("%time%") do (
    set current_time=%%a:%%b
)

REM 指定した時間と現在の時間が一致した場合、指定のURLを開きます
if "%current_time%"=="%target_time%" (
    start "" "https://www.example.com"  REM ここに指定のページのURLを入力します
)