Copy folder to many AD computer

Home Forums Scripting DOS Command Shell Copy folder to many AD computer

This topic contains 0 replies, has 1 voice, and was last updated by Avatar zonemaster24 1 year, 3 months ago.

Viewing 1 post (of 1 total)
  • Author
  • Avatar

    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

    SET PCLIST=pclist.txt

    PING -n 1 %PCLIST% >nul
    IF %ERRORLEVEL%==0 (

    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


Viewing 1 post (of 1 total)

You must be logged in to reply to this topic.