Solved

Dos Copy command to %userprofile% syntax error

Posted on 2008-10-24
1
5,314 Views
Last Modified: 2012-06-27
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

0
Comment
Question by:Aaron Goodwin
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
1 Comment
 

Accepted Solution

by:
Aaron Goodwin earned 0 total points
ID: 22798079
DOH, I guess I spoke too soon.. I just needed to use quotes

"%userprofile\my documents"
0

Featured Post

Salesforce Has Never Been Easier

Improve and reinforce salesforce training & adoption using WalkMe's digital adoption platform. Start saving on costly employee training by creating fast intuitive Walk-Thrus for Salesforce. Claim your Free Account Now

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

We have adopted the strategy to use Computers in Student Labs as the bulletin boards. The same target can be achieved by using a Login Notice feature in Group policy but it’s not as attractive as graphical wallpapers with message which grabs the att…
Issue: Unstable cursor in Windows XP and Windows runs extremely slow in that any click will bring up the Hour glass (sometimes for several seconds before giving you what you want) . Troubleshooting Process and the FINAL FIX: This issue see…
Two types of users will appreciate AOMEI Backupper Pro: 1 - Those with PCIe drives (and haven't found cloning software that works on them). 2 - Those who want a fast clone of their boot drive (no re-boots needed) and it can clone your drive wh…
Finds all prime numbers in a range requested and places them in a public primes() array. I've demostrated a template size of 30 (2 * 3 * 5) but larger templates can be built such 210  (2 * 3 * 5 * 7) or 2310  (2 * 3 * 5 * 7 * 11). The larger templa…

752 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question