Hi anyone there i’m newbie, can any one help me what is the problem on this code.
because i want to copy a folder to many domain computer with a list of ip address on text file. I wanted to ping first the ip and if no error it will proceed to copy file to the default destination.
Also after successfull it will proceed to the next ip address, with create logs for all ip mark to be ok. However it say access denied. to the ip address and i need to map first the ip address and enter the username and password and check the credential before i the batch file to be success.
Here the code i make.
PING -n 1 %PCLIST% >nul
IF %ERRORLEVEL%==0 (
) ELSE IF %ERRORLEVEL%==1 (
for /F “tokens=*” %%1 in (pclist.txt) do (
echo Copying files to %%1
xcopy “C:DeploymentRainmeter*.*” “\%%1c$Rainmeter” /e /c /f /h /g /y /r
xcopy “C:DeploymentRainmeterRainmeter.lnk” “\%%1c$ProgramDataMicrosoftWindowsStart MenuProgramsStartUp” /d /y