/build/static/layout/Breadcrumb_cap_w.png

package for a shorcut

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

Answers (5)

Posted by: turbokitty 14 years ago
6th Degree Black Belt
0
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
Posted by: elgwhoppo 14 years ago
Senior Purple Belt
0
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)
MyFile.WriteLine("[InternetShortcut]")
MyFile.WriteLine("URL=http://www.appdeploy.com")
MyFile.WriteLine("IconIndex=0")
MyFile.Close
Posted by: aogilmor 14 years ago
9th Degree Black Belt
0
I agree, that looks like a headache...crazy talk!
Posted by: turbokitty 14 years ago
6th Degree Black Belt
0
Hello,
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. [:)]
Posted by: anonymous_9363 14 years ago
Red Belt
0
Turbs,

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.
Rating comments in this legacy AppDeploy message board thread won't reorder them,
so that the conversation will remain readable.
 
This website uses cookies. By continuing to use this site and/or clicking the "Accept" button you are providing consent Quest Software and its affiliates do NOT sell the Personal Data you provide to us either when you register on our websites or when you do business with us. For more information about our Privacy Policy and our data protection efforts, please visit GDPR-HQ