Dos Copy command to %userprofile% syntax error

I have a number of systems on our network that I want to use a .bat file in the all users startup to copy files with.  So when a user logs in I want the bat file to run, copy the files from a share, to the users desktop.  The problem is, that a number of these machines were stand alone systems then were added to a domain.  This creates a problem where there are 2 profiles for each user, and the non-domain profile seems to be the default one.  So even if you blow away the non domain profile....the %username% varialble still tries to look for the non domain profile.

So I thought I would use the %profilename% instead, but I get a syntax error.  I also tried setting Username and Userprofile in the XP environment variables, but that didn't work either.  This should not be a difficult thing to do, but I'm at a loss.



c:
cd %userprofile%\Desktop
del filename*.*
copy P:\Filepath\Update~1\*.mde %userprofile%\Desktop\

Open in new window

Aaron GoodwinAsked:
Who is Participating?

[Webinar] Streamline your web hosting managementRegister Today

x
 
Aaron GoodwinConnect With a Mentor Author Commented:
DOH, I guess I spoke too soon.. I just needed to use quotes

"%userprofile\my documents"
0
All Courses

From novice to tech pro — start learning today.