[Last Call] Learn how to a build a cloud-first strategyRegister Now

x
?
Solved

Simple script problem

Posted on 2006-11-11
3
Medium Priority
?
135 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 85

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 85

Accepted Solution

by:
oBdA earned 2000 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

Prep for the ITIL® Foundation Certification Exam

December’s Course of the Month is now available! Enroll to learn ITIL® Foundation best practices for delivering IT services effectively and efficiently.

Question has a verified solution.

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

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…
If anyone asked you to network diagram of the internet, it was drawn in the form of a fluffy cloud which further became known as cloud computing. Popularly cloud computing is defined as workloads that run over the internet in a commercial provider’s…
We’ve all felt that sense of false security before—locking down external access to a database or component and feeling like we’ve done all we need to do to secure company data. But that feeling is fleeting. Attacks these days can happen in many w…
When cloud platforms entered the scene, users and companies jumped on board to take advantage of the many benefits, like the ability to work and connect with company information from various locations. What many didn't foresee was the increased risk…
Suggested Courses
Course of the Month17 days, 22 hours left to enroll

830 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