Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Batch File to copy files to a current user directory

Status
Not open for further replies.

colin81

Technical User
Jul 22, 2002
77
GB
Hi

Can anyone tell me the command to use on a batch file to copy a file to a users local directory i.e. I want to move Words normal.dot from a server to the users directory of C:\Documents and Settings\username\Application Data\Microsoft\Templates. Usename can be any user on the system or the user logging on who has this folder created.

Thanks for reading
Colin
 
You can try the following:

COPY H:\Templates\NORMAL.DOT "C:\Documents and Settings\%USERNAME%\Application Data\Microsoft\Templates" /y

The %USERNAME% should be replaced by the user's account name and the /y is a YES override prompt to overwrite the existing file.



"In space, nobody can hear you click..."
 
Oops.. add-on:

If your source is longer than 8.3 characters, you will need to put those in quotes also : ex: COPY "C:\Templates\normal.dot" ...



"In space, nobody can hear you click..."
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top