+ Post New Thread
Results 1 to 13 of 13
Scripts Thread, Script to copy a shortcut to all users and overwrite an exis in Coding and Web Development; I need a script to copy a shortcut from a location on our server to the all users desktop and ...
  1. #1
    tosca925's Avatar
    Join Date
    Aug 2005
    Location
    Midlands
    Posts
    1,547
    Thank Post
    4
    Thanked 4 Times in 4 Posts
    Rep Power
    22

    Script to copy a shortcut to all users and overwrite an exis

    I need a script to copy a shortcut from a location on our server to the all users desktop and all users start menu. All staff currently have a shortcut in this location but after reconfiguring our network the current short cut points to the wrong place. With 2000+ users, i cannot rely on them creating their own.

    Is there a way i can have a script that copies the new shortcut and tells it to over write the old one.

    Also if run in a GPO on Computer Configuration will it have the authority to do it or do i need a admin password in the script?

    Thanks

  2. #2

    Ric_'s Avatar
    Join Date
    Jun 2005
    Location
    London
    Posts
    7,592
    Thank Post
    109
    Thanked 770 Times in 598 Posts
    Rep Power
    183

    Re: Script to copy a shortcut to all users and overwrite an exis

    Do you not use re-directed desktops/start menus?

    If you have nasty roaming profiles you will have to delete them all and have them recreated.

  3. #3
    Guest

    Re: Script to copy a shortcut to all users and overwrite an

    Yeh if you redirect the desktops via GPO you just have to recreate the one shortcut on the server.

  4. #4
    ajbritton's Avatar
    Join Date
    Jul 2005
    Location
    Wandsworth
    Posts
    1,632
    Thank Post
    23
    Thanked 75 Times in 45 Posts
    Rep Power
    34

    Re: Script to copy a shortcut to all users and overwrite an

    @Ric_: Why will he have to do anything with his roaming profiles? He does not want to change them, only to affect the content of the All Users profile on his PCs. and STOP SLAGGING OFF ROAMING PROFILES.

    @tosca: You can run a startup script which copies anything from a network location to anywhere you like on the local computer. The only requirement is that you give the 'domain computers' group at least Read/List permissions to the share/files you will be copying from. Another solution is to include the files you are copying in the GPO scripts folder (the same place as the script is stored).

  5. #5

    Dos_Box's Avatar
    Join Date
    Jun 2005
    Location
    Preston, Lancashire
    Posts
    9,227
    Thank Post
    658
    Thanked 2,250 Times in 1,032 Posts
    Blog Entries
    23
    Rep Power
    670

    Re: Script to copy a shortcut to all users and overwrite an

    I'd go (and do) with re-directed desktop and start menus. I don't think Ric is being over critical of roaming profiles. He is merely pointing out one of the problems they create as opposed to centrally managing folders.

  6. #6
    DMcCoy's Avatar
    Join Date
    Oct 2005
    Location
    Isle of Wight
    Posts
    3,484
    Thank Post
    10
    Thanked 502 Times in 442 Posts
    Rep Power
    114

    Re: Script to copy a shortcut to all users and overwrite an

    Quote Originally Posted by Dos_Box
    I'd go (and do) with re-directed desktop and start menus. I don't think Ric is being over critical of roaming profiles. He is merely pointing out one of the problems they create as opposed to centrally managing folders.
    Except you can do the same thing with mandatory profiles. I add network wide shortcuts to the mandatory profile and machine specific to the local all users startmenu.

    Two different ways to do the same thing, they both have disadvantages and neither is entierly as flexible as we might like.

  7. #7

    Ric_'s Avatar
    Join Date
    Jun 2005
    Location
    London
    Posts
    7,592
    Thank Post
    109
    Thanked 770 Times in 598 Posts
    Rep Power
    183

    Re: Script to copy a shortcut to all users and overwrite an exis

    I mentioned the roaming profiles and then had a thought - you could write a script to change all 1000+ instances of the shortcut Mandatory profiles would require less effort since there would only be a handful to change.

    The most flexable way is still folder re-direction in this instance. If you aren't using this, it may be a good time to make the change.

  8. #8
    ajbritton's Avatar
    Join Date
    Jul 2005
    Location
    Wandsworth
    Posts
    1,632
    Thank Post
    23
    Thanked 75 Times in 45 Posts
    Rep Power
    34

    Re: Script to copy a shortcut to all users and overwrite an exis

    @Ric_: I think you may have misread the original post. I believe what tosca is aksing for is a script which copies shortcuts to the 'All Users' desktop and 'All Users' Start Menu as opposed to all users' desktops & start menus.

    When I get a chance (I'm on a training course this week), I will write a script which can be used to copy data to any location on PCs. I'll write it on the basis that the data will be included in the GPO (and should therefore be limited to shortcuts/links to keep it tight). It should be quiet simple, along the lines of;

    Code:
    xcopy "%0\..\AllUsersDesktop\*.*" "%ALLUSERSPROFILE%\Desktop" /s /y
    xcopy "%0\..\AllUsersStartMenu\*.*" "%ALLUSERSPROFILE%\Start Menu" /s /y
    etc.
    Sit the script at the top level of a directory structure as follows;

    .\ - Script goes here
    .\AllUsersDesktop - Links for All Users desktop
    .\AllUsersStartMenu - Links for All Users Start Menus
    etc.

    This should run fine as a startup script, provided the environment variables exist (if not, it will have to be in VB Script).

    The script (and associated dir structure) could be used on any GPO.

    PS - Ric_: Which is easiest for your USERS (you know, the people who you SERVICE), for you to write a script, or for them to recreate all their profiles and associated data?

  9. #9

    Geoff's Avatar
    Join Date
    Jun 2005
    Location
    Fylde, Lancs, UK.
    Posts
    11,819
    Thank Post
    110
    Thanked 588 Times in 509 Posts
    Blog Entries
    1
    Rep Power
    226

    Re: Script to copy a shortcut to all users and overwrite an exis

    You shouldn't use %0 in batch files on WinXP the results are unpredictable.

  10. #10
    ajbritton's Avatar
    Join Date
    Jul 2005
    Location
    Wandsworth
    Posts
    1,632
    Thank Post
    23
    Thanked 75 Times in 45 Posts
    Rep Power
    34

    Re: Script to copy a shortcut to all users and overwrite an

    @Geoff: That's interesting. Can you tell me any more about this? I've never had any problems (at least none that I've noticed)!

  11. #11

    Geoff's Avatar
    Join Date
    Jun 2005
    Location
    Fylde, Lancs, UK.
    Posts
    11,819
    Thank Post
    110
    Thanked 588 Times in 509 Posts
    Blog Entries
    1
    Rep Power
    226

    Re: Script to copy a shortcut to all users and overwrite an


  12. #12
    ajbritton's Avatar
    Join Date
    Jul 2005
    Location
    Wandsworth
    Posts
    1,632
    Thank Post
    23
    Thanked 75 Times in 45 Posts
    Rep Power
    34

    Re: Script to copy a shortcut to all users and overwrite an exis

    Thanks Geoff. It seems I should have used
    Code:
    %~0
    which removes the " marks.

  13. #13
    ajbritton's Avatar
    Join Date
    Jul 2005
    Location
    Wandsworth
    Posts
    1,632
    Thank Post
    23
    Thanked 75 Times in 45 Posts
    Rep Power
    34

    Re: Script to copy a shortcut to all users and overwrite an

    Quick and dirty file copying script.

    NB - THIS IS SUPPLIED WITH MINIMAL TESTING (BUT IT DID WORK, HONEST!), PLEASE TEST CAREFULLY BEFORE USING IN PRODUCTION ENVIRONMENT.

    1 - Create (or use an existing) GPO
    2 - Edit the GPO and go to Computer Config\Windows Settings\Scripts (Startup/Shutdown)
    3 - Double click Startup
    4 - Click Show Files...
    5 - Make a folder 'CopyShortcuts' and extract the content of the CopyShortcuts.zip file into it.
    6 - Copy any shortcuts into the sub-folders (AllUsersDesktop, AllUsersStartMenu etc.)
    7 - Close the explorer window to return to the Startup Properties dialog box
    8 - Click Add then Browse, CopyShortcuts (folder), CopyShortcuts.cmd, Open, OK
    9 - OK to close Startup Properties
    10 - Close GP Editor
    11 - Link to GPO to an OU containing computer accounts you want to apply the script to.

    If anyone uses this, let me know if it works/crashes. Thanks again to Geoff for headsup on %0
    Attached Files Attached Files

SHARE:
+ Post New Thread

Similar Threads

  1. Desktop shortcut deployment script
    By contink in forum Scripts
    Replies: 1
    Last Post: 29th May 2009, 07:12 PM
  2. Replies: 21
    Last Post: 29th December 2007, 10:53 PM
  3. Replies: 2
    Last Post: 14th December 2007, 10:33 AM
  4. VB Script ti check for folder and then copy contents to PC
    By tosca925 in forum How do you do....it?
    Replies: 4
    Last Post: 2nd October 2006, 08:15 PM
  5. script to copy files to machines
    By browolf in forum Scripts
    Replies: 1
    Last Post: 28th November 2005, 10:28 AM

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •