Solved

Simple script problem

Posted on 2006-11-11
3
128 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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

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…
Scenario: Your operations manager has discovered an anomaly in your security system. The business will start to suffer within 15 minutes if it is a major IT incident. What should she do? We have 6 recommendations for managing major incidents (https:…
This is used to tweak the memory usage for your computer, it is used for servers more so than workstations but just be careful editing registry settings as it may cause irreversible results. I hold no responsibility for anything you do to the regist…
In this video I am going to show you how to back up and restore Office 365 mailboxes using CodeTwo Backup for Office 365. Learn more about the tool used in this video here: http://www.codetwo.com/backup-for-office-365/ (http://www.codetwo.com/ba…

920 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

16 Experts available now in Live!

Get 1:1 Help Now