Is there an easy way to create an SMS job to put an internet shortcut (with ico file) on 'all user' desktops.
0 Comments   [ + ] Show Comments


Please log in to comment

Rating comments in this legacy AppDeploy message board thread won't reorder them,
so that the conversation will remain readable.


Just use a vbs script. SCCM program runs it with "cscript <name of script>".

<disclaimer> This is a quick and dirty script I just wrote and didn't check. Add more error checking and check if it works on all OSes you are targeting. </disclaimer>

option explicit
dim objFSO
dim sourcefile1, targetfile1

Const OverwriteExisting = TRUE
Set objFSO = CreateObject("Scripting.FileSystemObject")

sourcefile1 = "\\<SCCM SERVER>\smspkgd$\C010000\shortcut.lnk"
targetfile1 = "C:\Documents and Settings\All Users\Desktop"

'-------copy shortcut------------
If objFSO.FileExists(sourcefile1) Then
objFSO.CopyFile sourcefile1, targetfile1, OverwriteExisting
End if
Answered 08/24/2009 by: turbokitty
Sixth Degree Black Belt

Please log in to comment
This is less of a package solution, more of a "what I've found to be best practice" solution.

First of all, I would suggest not placing shortucts on the desktop, rather in Start > All Programs. The reason being is that managing user desktop shortcuts gets to be too difficult, some users make copies of shortcuts in their profile's desktop folder and it gets real ugly real quickly. As a part of our packaging standards, we provide and manage application shortcuts under Start > All Programs, and URL links under favorites via GPO. A quick and easy script now might turn into a profile parsing problem script later, which is usually a headache. Just my 2 cents.

Hey turbo, why not use the CreateTextFile method? I just had this one in my script bank.

Set sho = Wscript.CreateObject("Wscript.Shell")
Set fso = wscript.CreateObject("Scripting.FileSystemObject")
strAllUsersProfile = sho.expandenvironmentstrings("%AllUsersProfile%")
fso.deletefile(strAllUsersProfile & "\Desktop\Appdeploy.URL")
Set MyFile = fso.CreateTextFile(strAllUsersProfile & "\Desktop\AppDeploy.URL", True)
Answered 08/24/2009 by: elgwhoppo
Senior Purple Belt

Please log in to comment
I agree, that looks like a headache...crazy talk!
Answered 08/24/2009 by: aogilmor
Ninth Degree Black Belt

Please log in to comment
I don't use the CreateTextFile method because I'm a consultant and when I go away in a few weeks there's no one here to maintain my code. The way it's setup now, if they want to change the target (which they do a lot here), they can just drop a new shortcut in the source directory and update the DP.
And I totally agree with not putting shortcuts on the desktop, but many of my clients demand it, believe it or not!
You guys are both right in your approaches. [:)]
Answered 08/24/2009 by: turbokitty
Sixth Degree Black Belt

Please log in to comment

The solution I use in this situation - where there is a potential maintenance issue - is to use an INI file to contain the variable data. The script then reads the INI entries, converts them to strings (or whatever) which are then handled accordingly. The client then only has to edit an INI file.
Answered 08/25/2009 by: VBScab
Red Belt

Please log in to comment
Answer this question or Comment on this question for clarity