copy folder to multiple servers with different %userprofile%

半世苍凉 提交于 2019-12-13 03:23:31

问题


I do not have access to GPO or AD/OU, so what I found to do the easiest was to create a batch file for users.

Here is what I want to achieve :

I have over 50 servers, and 10 users that will be connecting to these machines. On those different machines, I want to populate, from 1 location (1 main server, 1 main location/main user), all the internet favorites (C:\Users\MAIN USER\Favorites\Links) to everyone on every machine...

I want to create a batch file, with minimum user manipulation, . So basicly, I will give the batch file to the 10 users, and they could launch it on 1 machine, and populate the links from their %USERPROFILE%, from the location of their choice.

I started figuring something with xcopy, but would like your advice/help on completing it.

    xcopy "\\NAMEOFMACHINE\C$\Users\MAIN USER\Favorites\Links" 
    "\\serverlist.txt\C$\Users\%USERPROFILE%\Favorites\Links" /E /I

I think this could be the easiest way to do so. As the initial location will be updated monthly with new links...


回答1:


if the user is running it then this should mirror the source to the target folder, making them identical.

@echo off
robocopy "\\NAMEOFMACHINE\C$\Users\MAIN USER\Favorites\Links"  "%USERPROFILE%\Favorites\Links" /mir


来源:https://stackoverflow.com/questions/18596640/copy-folder-to-multiple-servers-with-different-userprofile

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!