在Windows Server 2008中查找和replace文件

我正在更新每个用户configuration文件中的文件。 位置相当深\ profiles \\ appdata \ roaming \ microsoft \ imagelogo.jpg我将其replace为相同名称的较新文件。 我想为所有configuration文件执行此操作。 有没有一种好的方法来replace所有基于文件名的文件?

一举做到这一点的方法如下:

cd path\to\user\profiles for /d %i in (*) do copy /y newimagelogo.jpg %1\appdata\roaming\microsoft 

尽pipe如此,我还是会用Judascarcariot的回答,原因如下:

如果用户在运行时login,那么当前用户的漫游configuration文件中的图像将在注销时覆盖刚才复制的图像。

创build一个简单的批处理脚本(.bat)将文件从中央共享复制到当前用户configuration文件:

 dir \\centralfileserver\path\imagelogo.jpg if errorlevel = 1 goto exit xcopy \\centralfileserver\path\imagelogo.jpg %USERPROFILE%\appdata\roaming\microsoft\imagelogo.jpg :exit 

通过组策略将其分配为所有用户的login脚本