windows - Using Batch Script to open and close chrome however timeout only starts if I close chrome -


i'm trying write program open chrome, wait short period of time close chrome, , repeat. @ first working , began start timeout if closed chrome manually. i've tried these 2 codes each had same problem. code 1

    cd c:\program files (x86)\google\chrome\application\     :loop     chrome.exe https://www.website.com -incognito     timeout /t 200     taskkill /f /im chrome.exe /t > nul     goto loop 

code 2

    cd c:\program files (x86)\google\chrome\application\     :loop     chrome.exe https://www.website.com -incognito     timeout /nobreak /t 200>nul     taskkill /f /im chrome.exe /t > nul     goto loop 

my knowledge windows batch limited, , pieced lot of internet searches, problem simple , i'm not experienced enough see it. thank time!

not sure why, chrome.exe runs synchronously unless there chrome.exe process running. first time ran, had chrome running, why code worked asynchronously expected. when taskkill chrome processes, becomes synchronous, , no longer works want.

this issue has been reported @ http://www.dostips.com/forum/viewtopic.php?f=3&t=7242.

in case, solution simple - use start restore asynchronous behavior.

cd c:\program files (x86)\google\chrome\application\ :loop start "" chrome.exe http://www.dostips.com -incognito timeout /t 200 taskkill /f /im chrome.exe /t > nul goto loop 

Comments

Popular posts from this blog

java - Static nested class instance -

c# - Bluetooth LE CanUpdate Characteristic property -

JavaScript - Replace variable from string in all occurrences -