Solved

Dos Copy command to %userprofile% syntax error

Posted on 2008-10-24
1
5,245 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
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

IT, Stop Being Called Into Every Meeting

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

Join & Write a Comment

Can I legally transfer my OEM version of Windows to another PC?  (AKA - Can I put a new systemboard in my OEM PC?) Few of us are both IT and legal experts but we all have our own views of Microsoft's licensing rules and how they apply.  There are…
Sometimes people don't understand why download speed shows differently for Windows than Linux.Specially, this article covers and shows the solution for throughput difference for Windows than a Linux machine. For this, I arranged a test scenario.I…
This video shows how to remove a single email address from the Outlook 2010 Auto Suggestion memory. NOTE: For Outlook 2016 and 2013 perform the exact same steps. Open a new email: Click the New email button in Outlook. Start typing the address: …
You have products, that come in variants and want to set different prices for them? Watch this micro tutorial that describes how to configure prices for Magento super attributes. Assigning simple products to configurable: We assigned simple products…

747 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

Need Help in Real-Time?

Connect with top rated Experts

7 Experts available now in Live!

Get 1:1 Help Now