Solved

Simple script problem

Posted on 2006-11-11
3
127 Views
Last Modified: 2010-04-13
I am trying to run the following script via a batch file and when I run it, it tells me that the syntax is wrong. Can someone tell me where it is wrong???

copy \\server1\world\phones.url  \%userprofile%\application data\microsoft\internet explorer\quick launch

Thanks.
0
Comment
Question by:ainselyb
  • 2
3 Comments
 
LVL 83

Expert Comment

by:oBdA
ID: 17921411
Two errors: %userprofile% (as well "Internet Explorer" and "Quick Launch") contains spaces, so the path has to be enclosed in quotes, and you can't start the path with a backslash:
copy "\\server1\world\phones.url"  "%userprofile%\application data\microsoft\internet explorer\quick launch"
0
 
LVL 83

Accepted Solution

by:
oBdA earned 500 total points
ID: 17921423
Sorry, missed a third error (not related to your error message, though).
You're basically correct using %Userprofile% (instead of "C:\documents and settings\%username%", as way too many people do) when trying to access a user's profile; but when it comes to the application data, you should use another variable, "%AppData%":
copy "\\server1\world\phones.url"  "%appdata%\microsoft\internet explorer\quick launch"
0
 

Author Comment

by:ainselyb
ID: 17921493
Thanks you so very much! This was dead on - I so rarely get a 'dead on' answer - I very much appreciate it.
0

Featured Post

How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

Join & Write a Comment

Suggested Solutions

Short answer to this question: there is no effective WiFi manager in iOS devices as seen in Windows WiFi or Macbook OSx WiFi management, but this article will try and provide some amicable solutions to better suite your needs.
NTFS file system has been developed by Microsoft that is widely used by Windows NT operating system and its advanced versions. It is the mostly used over FAT file system as it provides superior features like reliability, security, storage, efficienc…
Here's a very brief overview of the methods PRTG Network Monitor (https://www.paessler.com/prtg) offers for monitoring bandwidth, to help you decide which methods you´d like to investigate in more detail.  The methods are covered in more detail in o…
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: …

759 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

22 Experts available now in Live!

Get 1:1 Help Now