What is all of this code (if you are so kind to call it that)? Please see my article What Is CDiag ("Comprehensive Diagnosis Tool")?, for the answer to that question. This is the BASE CDiag code, and you will get much more from it after you read the documentation, before proceeding any further.
Take the following code (everything INSIDE the "#####" lines). Please DO NOT include ANY portion of the "#####" lines. (Please verify computer names and ip addresses).
----------------------------------------------------------------------- ##### Start CDiag Base Code
@echo off set FullTarget1= set FullTarget2= set FullTarget3= set FullTarget4= set FullTargets=%FullTarget1% %FullTarget2% %FullTarget3% %FullTarget4% set FullTargets=%FullTargets% 127.0.0.1 set PingTargets=www.yahoo.com 66.94.230.32 Set Version=V1.40 @echo CDiagnosis %Version% >c:\cdiag.txt @echo Start diagnosis for %computername% >>c:\cdiag.txt @echo Full Targets %FullTargets% >>c:\cdiag.txt @echo Ping Targets %PingTargets% >>c:\cdiag.txt @echo. >>c:\cdiag.txt @echo Over All Analysis >>c:\cdiag.txt @echo. >>c:\cdiag.txt @echo Enumerate Shares >>c:\cdiag.txt @echo. >>c:\cdiag.txt net share >>c:\cdiag.txt @echo. >>c:\cdiag.txt @echo Adhoc Browser View >>c:\cdiag.txt @echo. >>c:\cdiag.txt net view >>c:\cdiag.txt @echo. >>c:\cdiag.txt @echo Full Targets Analysis %FullTargets% >>c:\cdiag.txt for %%a in (%FullTargets%) do ( @echo. >>c:\cdiag.txt @echo Target %%a >>c:\cdiag.txt @echo. >>c:\cdiag.txt @echo "%computername% ping %%a" >>c:\cdiag.txt @echo. >>c:\cdiag.txt ping %%a >>c:\cdiag.txt @echo. >>c:\cdiag.txt @echo "%computername% net view %%a" >>c:\cdiag.txt @echo. >>c:\cdiag.txt net view %%a >>c:\cdiag.txt ) @echo. >>c:\cdiag.txt @echo Ping Targets Analysis %PingTargets% >>c:\cdiag.txt for %%a in (%PingTargets%) do ( @echo. >>c:\cdiag.txt @echo Target %%a >>c:\cdiag.txt @echo. >>c:\cdiag.txt @echo "%computername% ping %%a" >>c:\cdiag.txt @echo. >>c:\cdiag.txt ping %%a >>c:\cdiag.txt ) @echo. >>c:\cdiag.txt @echo End diagnosis for %computername% >>c:\cdiag.txt notepad c:\cdiag.txt :EOF ##### End CDiag Base Code