This would be the batch code equivalent:
@echo off
set cnt=0
for %%v in (D:\MyFolder\*.dll) do (
regsvr32 /s "%%v"
call set cnt=%%cnt%%+1
)
echo Total dlls found and registered = %cnt%
Both batch code and VBScript have their uses. Generally I think you'll find batch code underpowered and a bit cryptic (six months from now will you remember what
%%v represents?).
VBScript can be a bit wordy and much work takes place in functions with positional parameters (six months from now will you remember the parameter order for the
instr function?)
VBScript combined with HTML code can create front-end GUIs for even the most boring of scripts. Batch code is strictly command line.
Both are good tools to know. If you find yourself doing repetitive computer chores, scripting is a fine way to automate them.