Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

For example, I would like to copy a shortcut.lnk to all of my individual users in windows xp. Therefore I want to do something like this:

echo | f xcopy \\server\networkpath\shortcut.lnk "c:\Documents and Settings\%\Application Data\Microsoft\Internet Explorer\Quick Launch\ /Y /f

It doesn't matter if its done in CMD or powershell, I just need something that works.

share|improve this question

1 Answer 1

up vote 1 down vote accepted

You'd probably do best by looping over the target directories, and copying the file into each. So something along the lines of

set sourcefile=%\\server\networkpath\shortcut.lnk%

if exist %sourcefile% (
  for /D %%to in (insert your target path pattern here) do (
    xcopy %sourcefile% %%to
  )
) ELSE (
echo  %sourcefile% not found
)

/D as opposed to /R performs the operation on the directories quoted, as opposed to recursing through them.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.