Link to home
Start Free TrialLog in
Avatar of noodleNT
noodleNT

asked on

Batch File to Copy files to %USERPROFILE%

I need to use the %USERPROFILE% as part of the Destination for some files to be copied to. Unfortunatly, the Copy command can not handle the LONG names correctly so you get an invalid command error.

Is there a way around this?

EXAMPLE:

copy "%Source%\file.txt" %USERPROFILE%\Folder
Avatar of noodleNT
noodleNT

ASKER

This will be in an XP/2k environment.
Avatar of Bartender_1
use quotes

copy "%root%\file.txt" "%userprofile\my documents"

Hope this helps!

:o)

Bartender_1
"%userprofile\my documents"
----------------^

What about the other Percent sign?
ASKER CERTIFIED SOLUTION
Avatar of Bartender_1
Bartender_1
Flag of Canada image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
THANKS!
Thank-you for the points!

Glad I was able to be of assistance.

:o)

Bartender_1