How to force folder onto Desktop with Active Directory?

blazeking

Weaksauce
Joined
Nov 16, 2004
Messages
126
Hi all,

I'm tasked with providing a shared folder on every user's desktop on login to the Directory (AD 2003). It will be a remote server (//server1/user). Am I going in the direction of roaming profiles here? The folder structure already exists on server1... I just want to the shortcut to show on the desktop after a user logs in. Any ideas?
 
Perhaps if you drop the shortcut in the default user desktop folder?
 
Perhaps if you drop the shortcut in the default user desktop folder?

That could work... but I've got users all over the place, and some use several computers. I'm hoping to setup a logon script or something similar.
 
just make a login script that maps a drive to \\server1\%username% then adds a shortcut to it on %profilepath%\desktop

easy as that.
 
Just add this line to your login script, i have used it before

copy /Y "\\server\folder\*.*" "%ALLUSERSPROFILE%\Desktop"

Make sure the folder only has the one folder in it, that will be copied. You may need to use xcopy instead though
 
Just add this line to your login script, i have used it before

copy /Y "\\server\folder\*.*" "%ALLUSERSPROFILE%\Desktop"

Make sure the folder only has the one folder in it, that will be copied. You may need to use xcopy instead though

Wouldnt that copy all the contents of the share to the folder on the desktop? He just needs a shortcut, not all of the contents copied to his computer.
 
Thank you everyone - good suggestions here. Mapping a drive might work, but I'd like it better if I just created a desktop shortcut (or network place) instead. So if user1 logs in to any computer in the directory, a shortcut to "//server1/user1" is on the desktop. User3 would see //server1/user3... and so on. Maybe I need to script a .vbs and call it with a .bat file login script?

If so, I'm stumped... I can copy/paste .vbs scripts, but I am no programmer.
 
Ok, I found some code to steal from Microsoft's Scripting Guy :) Here it is:

Const NETHOOD = &H13&

Set objWSHShell = CreateObject("Wscript.Shell")
Set objShell = CreateObject("Shell.Application")

Set objFolder = objShell.Namespace(NETHOOD)
Set objFolderItem = objFolder.Self
strNetHood = objFolderItem.Path

strShortcutName = "Backup Server"
strShortcutPath = "\\fileserver\%username%"

Set objShortcut = objWSHShell.CreateShortcut _
(strNetHood & "\" & strShortcutName & ".lnk")
objShortcut.TargetPath = strShortcutPath
objShortcut.Save

Set objShortcut = objWSHShell.CreateShortcut _
("C:\users\%username%\desktop\backup_server.lnk")
objShortcut.TargetPath = strNetHood & "\" & strShortcutName & ".lnk"
objShortcut.Save


The network location works fine, and the desktop link *almost* works. The %username% variable does not work. It runs fine if I change it to my username "bking", but I want this to be the same variable as the one used in the shortcut path in the network places. Any idea of the correct variable path to put the network places item onto the desktop as a shortcut?
 
Last edited:
Ok, finally got the .vbs script to do what I wanted (create a Network Place to \\server\%username%, then make a desktop shortcut). Here's the code:


Const NETHOOD = &H13&

Set objWSHShell = CreateObject("Wscript.Shell")
Set objShell = CreateObject("Shell.Application")

Set objFolder = objShell.Namespace(NETHOOD)
Set objFolderItem = objFolder.Self
strNetHood = objFolderItem.Path

strShortcutName = "Backup Server"
strShortcutPath = "\\fileserver\%username%"

Set objShortcut = objWSHShell.CreateShortcut _
(strNetHood & "\" & strShortcutName & ".lnk")
objShortcut.TargetPath = strShortcutPath
objShortcut.Save

Set objShell = CreateObject("WScript.Shell")
objDesktop = objShell.SpecialFolders("Desktop")

Set objShortcut = objShell.CreateShortcut(objDesktop & "\Backup_Server.lnk")
objShortcut.TargetPath = strNetHood & "\" & strShortcutName & ".lnk"

objShortcut.Description = "Creates link to folder share on backup server."
objShortcut.WorkingDirectory = strDesktop

objShortcut.Save



This works when I run it from a client machine. However, when I push this via GPO in Win2003 AD, nothing happens. No error message, no folders, nothing. Any ideas?
 
I recall this thread......had to revisit it today.
The new Q&A guy wants to have browser shortcut put on all users desktops. It's an http://blah blah blah some very long URL link that he needs..and he wants it to be named "MSDS"..and be available on all users desktops, including laptop users who roam in and out of the office.

Me stumped on the approach on getting it done.
 
I recall this thread......had to revisit it today.
The new Q&A guy wants to have browser shortcut put on all users desktops. It's an http://blah blah blah some very long URL link that he needs..and he wants it to be named "MSDS"..and be available on all users desktops, including laptop users who roam in and out of the office.

Me stumped on the approach on getting it done.

If it helps, I finally got my GPO to work correctly. I was processing that script to run against the computer, instead of the user. As soon as I put it as a "LOGON" script, rather than a "STARTUP" script, that did the trick.
 
I found a nice app (old app) called "Repl123" made by Julietta Alaverdian
put a list of machines in it and point it to the file to deploy and where to deploy it and press 'replicate'
I pushed Cpuz to ~1200 machines last night in ~8min
 
I recall this thread......had to revisit it today.
The new Q&A guy wants to have browser shortcut put on all users desktops. It's an http://blah blah blah some very long URL link that he needs..and he wants it to be named "MSDS"..and be available on all users desktops, including laptop users who roam in and out of the office.

Me stumped on the approach on getting it done.

What's funny is you start putting stuff on people's desktops and they will start to complain about extra junk they don't care about.

We setup an intranet with all the crap that people want people to see, but so many people can't click their way out of a wet paper bag, so, no one either A.) knows about it, B.) wants to use it C.) Don't give a shit.

Just my 2 cents.
 
What's funny is you start putting stuff on people's desktops and they will start to complain about extra junk they don't care about.

We setup an intranet with all the crap that people want people to see, but so many people can't click their way out of a wet paper bag, so, no one either A.) knows about it, B.) wants to use it C.) Don't give a shit.

Just my 2 cents.

Yeah I know..but it's being directed by Q&A management....and management of this clients approves my invoices..thus pays my bill.
 
I found a nice app (old app) called "Repl123" made by Julietta Alaverdian
put a list of machines in it and point it to the file to deploy and where to deploy it and press 'replicate'
I pushed Cpuz to ~1200 machines last night in ~8min

My Google skillz apparently lacking in finding this "Repl123". :(
 
I couldn't find anything either, by her name or Repl123. Links please. This could be handy.
 
I recall this thread......had to revisit it today.
The new Q&A guy wants to have browser shortcut put on all users desktops. It's an http://blah blah blah some very long URL link that he needs..and he wants it to be named "MSDS"..and be available on all users desktops, including laptop users who roam in and out of the office.

Me stumped on the approach on getting it done.

I had a script at one point that did exactly this. I had a link to our internal website...
I don't use that script anymore, I'll try to find it again.
 
Here you are:

set WshShell = WScript.CreateObject("WScript.Shell")
strDesktop = WshShell.SpecialFolders("Desktop")
set oUrlLink = WshShell.CreateShortcut(strDesktop & "\Bing Website.url")
oUrlLink.TargetPath = "http://www.bing.com"
oUrlLink.Save

Tested this in XP and Vista both...
 
I tried pushing the file with Group Policy.
It's an Internet Explorer shortcut...called Welcome to MSDS online HQ

It's SBS2K3 R2 that runs their network.
I created and linked a GPO, went to User Config, Windows Settings, Internet Explorer Maintenance, URLs/Favorites and Links..and I added the favorite and plugged in the long link.

gpupdate /force....and I remoted into another computer on the network and it was in the IE favorites list.

Cool...so I went to Administrator Templates in the GPO, Desktop/Active Desktop, Add/Delete items...and hoped I could copy that IE shortcut to desktops through this. At first I had the file located in say, C:\Download\Welcome to MSDS online HQ
no luck
I then tried putting that IE shortcut in the default share of ClientApps..and added the UNC path instead. So \\server\clientapps\Welcome to MSDS online HQ

Still no luck.

Does Active Desktop have to be enabled in the GPO in order to copy files to it?
 
Here you are:

set WshShell = WScript.CreateObject("WScript.Shell")
strDesktop = WshShell.SpecialFolders("Desktop")
set oUrlLink = WshShell.CreateShortcut(strDesktop & "\Bing Website.url")
oUrlLink.TargetPath = "http://www.bing.com"
oUrlLink.Save

Tested this in XP and Vista both...

You Rock TS! Ended up doing the script approach..and it's working.
 
You Rock TS! Ended up doing the script approach..and it's working.

Yea, scripting seems alot easier. I've finally got my scripts working with ease.

I've got Launchapp working for the Vista clients, along with the XP clients. So it's pretty good... I have a CMD file run (which can take care of command-line stuff like NET USE), which then later calls each of my vbs scripts (that do things like create this desktop shortcut). And I only ever have 1 VBS script do 1 thing. 1 maps drives, 1 gives them the network use message, 1 gives them the desktop icon, etc.

Makes scripting very easy.
 
Why a desktop shortcut?? Why can't it just be a mapped drive?? :confused:

Some users are whiny. It's alot easier to give them a darn shortcut via a script than to teach them how to find "my computer"... Retarded, I know... But sometimes it's not worth the battle.
 
Some users are whiny. It's alot easier to give them a darn shortcut via a script than to teach them how to find "my computer"... Retarded, I know... But sometimes it's not worth the battle.

Sheesh... :)

My users would complain if I had a shortcut on their desktops now... they like their 'S' drive! :D
 
Back
Top