Solved

Simple script problem

Posted on 2006-11-11
3
131 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
[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
  • 2
3 Comments
 
LVL 84

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 84

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

Free Tool: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Suggested Solutions

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…
While it may be true that the internet is a place of possibilities, it is also a hostile environment lurking with many dangers. By clicking on the wrong link, trusting the wrong person or using a weak password, you are virtually inviting hackers to …
I've attached the XLSM Excel spreadsheet I used in the video and also text files containing the macros used below. https://filedb.experts-exchange.com/incoming/2017/03_w12/1151775/Permutations.txt https://filedb.experts-exchange.com/incoming/201…

726 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