Try Online's Extension to /run

//xrun -wh $+(%,comspec%) /c ping www.google.com> $mircdirgoogle.txt | loadbuf -s google.txt

%comspec% is an environment variable that will evaluate to the path of the command executable, therefore it doesn't matter which OS someone is using.

The h flag keeps the program hidden, using the w flag makes the code wait with executing the following command until the program is done.

This snippet takes advantage of the Windows Script Host (WSH) Run method