# Placing a icon on all users desktops & start menu

I need to place a icon on all users desktops and create folders for their start menu's.

We run Windows 2003 Server R2, with 2000 and XP on the desktop.
All users have re-directed Desktops, Start menus, and My Documents.

I need to copy a shortcut to their desktop and create 2 new folders with a bunch of links/shortcuts in them for the start menu.

We can obviously do this manually, but where is the fun in that.
I can create a script that says
copy C:\ICONS_TO_COPY_TO_EVERYONES_DESKTOP\*.* C:\REDIRECTED_DESKTOPS\testuser01\Desktop /Y
but that involves creating over 150 of these customised to everyones username. I cant get the %username% to work, not sure that it can in a batch file.

I was mucking aorund with the following but again same issue with the %username% not working.
ECHO OFF
cls
net use t: /delete
net use t: \\test-jim-01\ICONS_TO_COPY_TO_EVERYONES_DESKTOP$copy t:\*.* C:\everyones_desktop\%username%\Desktop /Y net use t: /delete I figure once I get the process down, adding in anythng to anywhere will be easy enough. Does anyone have any suggestions on how I get aorund the username issue? Guess I can do it through a login script, this might be the only way to the the %username% working, but thought it was worth a shot doing it this way. LVL 1 CTOAsked: ###### Who is Participating? I wear a lot of hats... "The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S. Technology and Business Process AdvisorCommented: Sorry, I'm a little confused ... why not just copy the files to the all users desktop? Such an action would potentially require a five line script from a single system with a domain admin privilages: @echo off for /f "tokens=1" %%a in ('net view ^| find "\\"') do ( copy "\\server\share\path\to\files\for\desktop" "%%a\c$\documents and settings\all users\desktop"
copy "\\server\share\path\to\files\for\startmenu" "%%a\c$\documents and settings\all users\startmenu" ) Technology and Business Process AdvisorCommented: Any machine visible when you run "net view" at the command line will get the update. If you want, you can substitute a variety of things for the computer list instead. An IP Address Range (the for command will change some but is still used). You can create a list of computers and use the list of computers as the computers to get the update. CTOAuthor Commented: yes after all that I got back to basics and went with the following which seems to work based on a users login script. XCOPY \\test-jim-01\ICONS_TO_COPY_TO_EVERYONES_DESKTOP$\Document.txt  \\test-jim-01\desktop\%username%\desktop\ /y

Guess I got myself confused with the re-directed profiles, as I was trying to mapp to their local C:\ drive and as it didn't exist there it was failing and i just got tunnel vision on a problem that was not even there.

CTOAuthor Commented:
however I must add, not being very handy with scripts that your suggestion will spur me on to learn a little more about it, that looks very handy, and obviously simple to you, but something I have never seen.
Commented:
Use %userprofile%\desktop in your script or %allusersprofile%. The variables have to work in batches, but %userprofile% can only work in a login, not in a startup script. Try echo %userprofile% too find out, what's wrong.
A domain startup script could be
--
copy \\server\->share_that_is_accessible_for_machine_accounts_ie_group_domain_computers<-\*.* %allusersprofile%\desktop /y >%windir%\alreadysetup.txt
:end
--
Commented:
oops,
--
--
:end
--
CTOAuthor Commented:
Something I'm just about to try but if I want to create a folder with shortcuts and links in it, can I simply copy the folder over or do I need to do something more fancy? The folder should end up in the Start Menu.
You can just copy the folder over.  Note: I have seen shortcuts get perisistant about where they execute the application - for example, I created a shortcut to an access database for one of my clients using one of their systems.  When I copied it to other systems, each system ran access from the system I originally created the shortcut on - this caused a problem in that if that machine were off, no one could open the access database (sure they could have not using the shortcut, but we're not talking about technologically savvy people here).  My solution was to dynamically create the shortcut in the login script using the shortcut tool available from www.optimumx.com - worked great.

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

CTOAuthor Commented:
many thanks for all of this, will certainly point me in the right direction.
Commented:
No, nothing fancy.
Second correction to my clumsy script:
:end
McKnife - it's not a bad idea, but there's a flaw in your implementation - users on XP systems do not have write access to %windir% unless they are admins.  There are two work-arounds.

1.  Put the file in %userprofile% or %userprofile%\%username%
2.  Skip the alreadysetup.txt file entirely and simply check for the existance of the shortcuts you wanted to copy - if they are there, don't copy them, if they aren't, copy them.

The only problem I can see with 2 is in the event the shortcuts are not new but rather are changing... but then you might be able to simply use comp and check for an errorlevel.
Commented:
NO, it's no flaw, it is no login script but a startup script, executed with machine rights.
Perhaps I'm not catching your meaning...

Do you mean a Group Policy based logon script?

Do you mean a "Scheduled task"?

Do you mean a batch file in the Programs/Startup group?

Now, I could have missed something in the past, but I've not seen any way to get a batch file to execute under system rights.  AD Logon Script (which I thought did it) didn't work when I tested it.  The startup group won't work that way and the scheduled tasks need a user account - and I've never seen a way to specify the local system account (which is what I assume when you say machine rights).
Commented:
<<...but I've not seen any way to get a batch file to execute under system rights>> Oh, then it's your lucky day! There are two types of scripts in gpos, startup scripts and logon scripts.
Startup scripts use the account %computername%\$ and have full access to everything, it is the system account.
Logon scripts use the account %username%

Thing is, if you would like to use a startup script, than that script has to be accessible to the machine account (or to the group domain computers).
Try it out.
###### It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Windows Server 2003

From novice to tech pro — start learning today.