User profile variable

  • Thread starter Thread starter Pat
  • Start date Start date
P

Pat

Hello, I would like to create a small batch file that
copies a file to a users profile in Windows 2000 Pro. My
guess is that I will need to use an Environment Variable
to achieve this. I am aware that the variable for the user
profile is %USERPROFILE%, however when I try to copy the
file I get a syntax error.

copy file %USERPROFILE%\Desktop

Any ideas?

Thank you
 
Pat said:
Hello, I would like to create a small batch file that
copies a file to a users profile in Windows 2000 Pro. My
guess is that I will need to use an Environment Variable
to achieve this. I am aware that the variable for the user
profile is %USERPROFILE%, however when I try to copy the
file I get a syntax error.

copy file %USERPROFILE%\Desktop

Any ideas?

Thank you

As a rough guess I would say that you have spaces embedded
in "%UserProfile%". Try this instead:

copy /y file "%USERPROFILE%\Desktop"
 
Back
Top