Avatar of quippee
quippee
 asked on

copy script from userlist

Hello experts, I would liek to copy files from the user profiles to another folder where the user has another folder.

for exampple for user lisa

copy c:\profiles\list\*.*   d:\backup\lisa\

for one user is not problem, but i have a a list of users  in  a text file and I was wondering if there is a way to use that list to inser it in the username part. something like this

copy c:\profiles\%username%\*.*  d:\backup\%username%   Where the username is picked from a list and then it moves to the next.

Im sure there is a way. Just that im not an expert :)
Windows Server 2003

Avatar of undefined
Last Comment
quippee

8/22/2022 - Mon
ASKER CERTIFIED SOLUTION
TG Tran

THIS SOLUTION ONLY AVAILABLE TO MEMBERS.
View this solution by signing up for a free trial.
Members can start a 7-Day free trial and enjoy unlimited access to the platform.
See Pricing Options
Start Free Trial
GET A PERSONALIZED SOLUTION
Ask your own question & get feedback from real experts
Find out why thousands trust the EE community with their toughest problems.
quippee

ASKER
Thanks that worked. but I also used powershell. which was a lil better for now.

example to move documents

$a = get-content c:\users.txt
foreach ($i in $a)
{move-item "Z:\profiles\$i\My documents" "z:\profles2\home\$i\"}
I started with Experts Exchange in 2004 and it's been a mainstay of my professional computing life since. It helped me launch a career as a programmer / Oracle data analyst
William Peck