Copy folder to many AD computer
- This topic has 0 replies, 1 voice, and was last updated 2 years, 4 months ago by .
Viewing 1 post (of 1 total)
Viewing 1 post (of 1 total)
You must be logged in to reply to this topic.
Home › Forums › Scripting › DOS Command Shell › Copy folder to many AD computer
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.
[USER=”68995″]Echo[/USER] off
:BEGIN
SET PCLIST=pclist.txt
PING -n 1 %PCLIST% >nul
IF %ERRORLEVEL%==0 (
GOTO INSTALL
) ELSE IF %ERRORLEVEL%==1 (
GOTO END
)
:INSTALL
for /F “tokens=*” %%1 in (pclist.txt) do (
echo Copying files to %%1
MD “\%%1c$Rainmeter”
xcopy “C:DeploymentRainmeter*.*” “\%%1c$Rainmeter” /e /c /f /h /g /y /r
xcopy “C:DeploymentRainmeterRainmeter.lnk” “\%%1c$ProgramDataMicrosoftWindowsStart MenuProgramsStartUp” /d /y
MD “\%%1d$Desktop”
xcopy “C:DeploymentRainmeterDesktop*.*” “\%%1d$Desktop” /e /c /f /h /g /y /r
icacls “\%%1d$Desktop” /grant Everyone:M
echo %Date% >>C:Deploymentmakelog.txt %Time% >>C:Deploymentmakelog.txt
)
:END
exit
You must be logged in to reply to this topic.
Find out more about our cookie policy here.