Hopefully a simple thing: copy shortcut to all desktops in domain

Joined
Sep 17, 2012
Messages
767
I've been asked to copy a shortcut to a website to everyone's desktops within a domain.

It's a mix of XP, Vista, and Windows 7.

I know it needs to be copied to All Users\Desktop or Public\Desktop.

What would be the best way to do this? I figure I can update the login scripts, but I'd have to play with the syntax to get it to do what I want, as I'm not sure how it'll work with the different operating systems. I'm sure there's a wildcard in there somewhere I can use.

Or should I be looking at Group Policy for it, and if so, where would I look?
 
psexec \\* -u domain\administrator -p password "\\server\copy.bat"

\\server\copy.bat:

Code:
set copypath="C:\Documents and Settings\All Users"
if exist not %copypath% (set copypath="C:\Users\Public")
copy \\server\file.url %copypath%\Desktop\file.url

Something like that should work.
 
PSExec would be tough, as you'd need to fiddle with access and get a list of all the computers, AND they'd have to be online at the same time.

You could deploy the Group Policy Client Side extentions to your Windows XP machines. With that installed, you could use a preference policy to make sure the file exists on every machine. It's not native to XP though, so you'd have to have the CSE installed.

Another way is, like you said, the login script. I'd use something like this:

Code:
If Not Exist "%allusersprofile%\desktop\[color=orange]FILENAME[/color]" copy "[color=orange]\\SERVER\SHARE\FILENAME[/color]" "%allusersprofile%\desktop" /y

Just replace the variables in CAPS with the correct info and you should be good to go.
 
%appusersprofile% is a variable that points to the all users profile. It's purpose is so you don't have to go scripting around trying to find where profiles are stored.

XP: C:\Documents and Settings\all users
XP and Higher: C:\Programdata

Both of these location contain a desktop folder. Putting something in this desktop folder will put it on the desktop of all users that log into the machine.

It works fine in vista and higher.
 
Probably the easiest way is to use group policy preferences and push out a shortcut via that, as Demon10000 mentioned. However, that does require the XP machines have KB943729 installed. It'd be worth checking to see if that update was pushed out. It's kind of an old update, so there's a reasonable chance it has been.
 
Wouldn't Vista and higher be C:\Users\Public\Desktop ?

Technically Demon10000 and I are both right. The correct path is %PUBLIC% (C:\Users\Public\Desktop) but %ALLUSERSPROFILE% would work as C:\ProgramData\Desktop is a directory junction to C:\Users\Public\Desktop.
 
I am trying the Group Policy option. They should have the KB installed, as we have other policies applied.
Remember; it's not policies but preferences. They may or may not have the KB installed, I believe it's actually optional. So unless they forced it via WSUS or some other method, it won't be installed.

It's bloody useful though, so I wouldn't be shocked if someone DID get it installed.
 
oh, new dogs can still learn new tricks.....I didn't know that was a junction
 
Back
Top