I got this command below.
@echo off
pushd %~dp0
echo "checking unhealthy cmclient" >> %~dp0\pc_down_info.txt
for /F %%M in (%~dp0\pc_info.txt) do (
ping -n 1 -w 1 %%M >nul
if errorlevel 1 echo %%M is down >> %~dp0\pc_down_info.txt
If not errorlevel 1 (
cd c:\psexec
psexec -d -i \\%%M %~dp0\FixCM.exe
)
)
pause
I'll try to execute a file remotely using psexec. I got the list of PC's in pc_info.txt. And Im trying to execute FixCM.exe which is in a shared drive. But it prompts "Syntax command is incorrect". Whats wrong with my code?