Jscript inside Batch File -
i want run below code in bat
file:
@echo off echo --------------------------------- ping -n 1 google.com | find "ttl=" >nul if errorlevel 1 ( echo google = offline ) else ( echo google = online )
then want next code below run in if errorlevel 1
:
wshshell.appactivate "mozilla firefox" wshshell.sendkeys "google offline" wshshell.sendkeys "{enter}"
how run code above?
last code run in vbs
extension, want run in bat
extension.
this "frankenscript"; such term! ;)
@set @a=0; /* @echo off echo --------------------------------- ping -n 1 google.com | find "ttl=" >nul if errorlevel 1 ( echo google = offline cscript //nologo //e:jscript "%~f0" if nextsection == jscript ( */ wshshell = wscript.createobject("wscript.shell"); wshshell.appactivate("mozilla firefox"); wshshell.sendkeys("google offline"); wshshell.sendkeys("{enter}"); /* ) ) else ( echo google = online ) rem */
Comments
Post a Comment