I
IT STAFF
For /F %%i In (%filename%) Do Call ing4Name %%i
ing4Name
For /F "Tokens=2" %%a In ('ping -n 1 %1 ^| find /i "Reply"') Do (
cusrmgr.exe -u %admin% -m \\%1 -P %password% > nul
if errorlevel 0 echo %1 successful
)
=========================================================================
my %filename% contains a text file with pc names.
if errorlevel 0 echo %1 successful ==> echo successful when machine is ping
and password changed. For those machines unable to ping, i wish to do a ELSE
statement that echos unsuccessful, but not able to do so.
cusrmgr.exe returns 0 for success, ERROR for not success.
Pls advise
ing4Name
For /F "Tokens=2" %%a In ('ping -n 1 %1 ^| find /i "Reply"') Do (
cusrmgr.exe -u %admin% -m \\%1 -P %password% > nul
if errorlevel 0 echo %1 successful
)
=========================================================================
my %filename% contains a text file with pc names.
if errorlevel 0 echo %1 successful ==> echo successful when machine is ping
and password changed. For those machines unable to ping, i wish to do a ELSE
statement that echos unsuccessful, but not able to do so.
cusrmgr.exe returns 0 for success, ERROR for not success.
Pls advise