Solved copy to variable username

November 7, 2012 at 09:53:05
Specs: Windows 7

I'm trying to create a script which copies data from G:\Apps\Data to C:\Users\%UserName%\AppData\Local\SomeFolder

This is what i'm trying:

md C:\Users\%UserName%\appdata\local\somefolder\
copy  G:\Apps\Data\*.* C:\Users\%UserName%\AppData\Local\Somefolder

Somthing is going wrong, the output in DOS says ït cannot find the specified path.

Anyone an idea?
Thanks in advanvce

See More: copy to variable username

Report •

November 7, 2012 at 11:43:14
There is an extra space before the directory in the copy line, this might be it?
Is your UserName a spaced or hypenated name?

:: mike

Report •

November 7, 2012 at 16:38:04
✔ Best Answer
Yes, probably those good old spaces. If so try:
md "C:\Users\%UserName%\appdata\local\somefolder\"

copy G:\Apps\Data\*.* "C:\Users\%UserName%\AppData\Local\Somefolder"

and post content of %username%

Report •

Related Solutions

Ask Question