Batch file to copy IE shortcut to all users

Posted on 2005-05-10
Last Modified: 2010-04-13
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

Question by:Joe
    LVL 24

    Expert Comment

    by:Dufo G. Belski
    Try this:

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

    Author Comment

    Just tried it and still said cannot find the specified file thanks though. Any other ideas?

    LVL 82

    Accepted Solution

    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
    LVL 16

    Author Comment

    Your the man! it works thank you very much saved me alot of time :/


    Write Comment

    Please enter a first name

    Please enter a last name

    We will never share this with anyone.

    Featured Post

    IT, Stop Being Called Into Every Meeting

    Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

    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…
    Find out how to use Active Directory data for email signature management in Microsoft Exchange and Office 365.
    This video discusses moving either the default database or any database to a new volume.
    Polish reports in Access so they look terrific. Take yourself to another level. Equations, Back Color, Alternate Back Color. Write easy VBA Code. Tighten space to use less pages. Launch report from a menu, considering criteria only when it is filled…

    761 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

    11 Experts available now in Live!

    Get 1:1 Help Now