• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 448
  • Last Modified:

Batch file to copy IE shortcut to all users

Hi all we have a batch file here that executes every time a user logs in now what i am trying to do is have it copy a shortcut to the users desktop. I have no problem trying to copy a regular extension ex. .lnk or .txt but what i am trying to copy over is a shortcut to an html link here is an example of what i had. If anybody has any solutions for this much would be appriciated thank you!

copy "\\myserver\mis\shortcuts\Web-ECI.html" "c:\documents and settings\%username%\desktop" /y

  • 2
1 Solution
Dufo G. BelskiRetired bureaucrat/desktop supportCommented:
Try this:

copy "\\myserver\mis\shortcuts\Web-ECI.html.LNK" "c:\documents and settings\%username%\desktop" /y
JoeAuthor Commented:
Just tried it and still said cannot find the specified file thanks though. Any other ideas?

URL shortcuts have the extension ".url"; open a command prompt, enter
cd %Userprofile%\favorites
and then enter
It will show the favorites, with the proper extension (which is hidden by default in Explorer, even if it's set to display file extensions).
Then never, ever, use "C:\Documents and settings\%username%" to access a user's profile; this path is *not* necessarily correct.
Always use %Userprofile%, which points to the user's profile root.
So the following should work for you:
copy "\\myserver\mis\shortcuts\Web-ECI.html.url" "%Userprofile%\desktop" /y
JoeAuthor Commented:
Your the man! it works thank you very much saved me alot of time :/

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

Cloud Class® Course: Microsoft Windows 7 Basic

This introductory course to Windows 7 environment will teach you about working with the Windows operating system. You will learn about basic functions including start menu; the desktop; managing files, folders, and libraries.

  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now