batch script

Forum discussion tagged with batch script.
  1. C

    Question Using FINDSTR to filter output of a command

    Hello! I have a section of one script that gets the last 5 of the installed product key. The goal is to run it on all machines to get an inventory of Office licenses. It works great but sometimes the output of cscript "C:\Program Files\Microsoft Office\Office16\OSPP.VBS" /dstatus will contain...
  2. AlvinSeville

    Question How to pipe output of some command to batch function?

    Hello! I try to write Batch script similar to Bash one (open in Repl.it): function f() { read foo echo "$foo" } echo "arg" | f I've written it: @echo off echo arg|call :f pause @echo on @goto :eof :f set /p foo="" echo %foo% exit /b 0 :eof , but this variant doesn't work...
  3. M

    [SOLVED] How do I make this batch script stop restarting the adapter after 10 restarts?

    How do I make this windows batch script stop restarting the adapter after 10 restarts? @echo off :loop timeout /t 8 echo Checking... ping -n 1 192.168.1.1|Findstr /I /C:"timed" /C:"unreachable" /C:"find host" /C:"failure" if %errorlevel%==0 (echo Restarting... netsh interface set interface...