S
Stel
One thing I love about IT. no matter how long you do it (over 16 yrs
for me) or how good you think you are (with .cmd .bat files) you can
always learn something ... So today I'm ready to learn!
Found a cool script today using this code.
for /F "delims=" %%a in ('schtasks /query /v /fo:list ^| findstr /i
"Taskname Result"') do call :Sub %%a
While I think I'm familiar with the for /f command I've not seen the
"^" character used. This line supplies one line of output from the
schtasks utility to the :sub routine, at a time which is really cool
with findstr filtering. So can someone school me on how this ^ was
used? or send me to a URL that I can learn this. Several uses come to
mind.
Thanks in advance,
Stel
note: If you're interested this came from a script that monitors
local scheduled tasks and blats alerts
(http://forums.techarena.in/server-scripting/972774.htm)
for me) or how good you think you are (with .cmd .bat files) you can
always learn something ... So today I'm ready to learn!
Found a cool script today using this code.
for /F "delims=" %%a in ('schtasks /query /v /fo:list ^| findstr /i
"Taskname Result"') do call :Sub %%a
While I think I'm familiar with the for /f command I've not seen the
"^" character used. This line supplies one line of output from the
schtasks utility to the :sub routine, at a time which is really cool
with findstr filtering. So can someone school me on how this ^ was
used? or send me to a URL that I can learn this. Several uses come to
mind.
Thanks in advance,
Stel
note: If you're interested this came from a script that monitors
local scheduled tasks and blats alerts
(http://forums.techarena.in/server-scripting/972774.htm)