将文件夹复制到具有不同%userprofile%的多个服务器 [英] copy folder to multiple servers with different %userprofile%

查看:86
本文介绍了将文件夹复制到具有不同%userprofile%的多个服务器的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我没有访问GPO或AD/OU的权限,所以我发现最简单的方法是为用户创建一个批处理文件.

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 :

我有超过50台服务器,并且有10个用户将连接到这些计算机. 在这些不同的计算机上,我想从1个位置(1个主服务器,1个主要位置/主要用户)填充所有Internet收藏夹(C:\ Users \ MAIN USER \ Favorites \ Links)到每台计算机上的每个人.

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...

我想创建一个批处理文件,并且用户操作最少.因此,基本上,我将批处理文件提供给10个用户,他们可以在一台计算机上启动该文件,并从他们选择的位置的%USERPROFILE%中填充链接.

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.

我开始用xcopy弄些东西,但是希望您对它有所帮助.

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...

推荐答案

如果用户正在运行它,则应将源镜像到目标文件夹,使它们相同.

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

这篇关于将文件夹复制到具有不同%userprofile%的多个服务器的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆