Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium

  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 442
  • 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 :/


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.

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