Computing.Net > Forums > Windows XP > Script to create shortcut

Computer Problems? Computing.Net has over 1,000,000 posts about all things technology related! Over 90% answered within 24 hours! Click here to start participating now! Also, be sure to check out the New User Guide.

Script to create shortcut

Reply to Message Icon

Name: Chris (by Chris Kirk)
Date: March 4, 2008 at 12:17:48 Pacific
OS: XP
CPU/Ram: _
Product: _
Comment:

Hello,
I would like a script to make a shortcut to programs and to files on users desktop, if this is possible. I would like a VBScript or a different type of script to do this, rafer than manually adding them to each users desktop. Not sure how do this as I am new to scripting.
Any Help,
Thanks




Sponsored Link
Ads by Google

Response Number 1
Name: Jennifer SUMN
Date: March 4, 2008 at 12:21:55 Pacific
Reply:

Are you running a Domain with AD?

Life's more painless for the brainless.


0

Response Number 2
Name: Chris (by Chris Kirk)
Date: March 4, 2008 at 12:28:20 Pacific
Reply:

No it is just local, and workgroup, so i just want to add them to start ups (in the start menu), some on On all users, some on shared profile, and other just for the that user on the PC.

Also if it could also allow me pick the icon that displays on the shortcut.
Thanks


0

Response Number 3
Name: Michael J (by mjdamato)
Date: March 4, 2008 at 14:16:30 Pacific
Reply:

Here is some code in one of my VBScripts that creates a shortcut:


'Create environment variables
Dim WSHShell, DesktopPath
Set WSHShell = WScript.CreateObject("WScript.Shell")
DesktopPath = WSHShell.SpecialFolders("Desktop")

'Define the shartcut targets and names
Dim shortcutTarget32: shortcutTarget32 = target32 & "\executable.exe"
Dim shortcutPath32: shortcutPath32 = DesktopPath & "\" & shortcutName32 & ".lnk"


Dim Shortcut32, StartupPath32
Set Shortcut32 = WSHShell.CreateShortcut(shortcutPath32)
Shortcut32.TargetPath = shortcutTarget32
StartupPath32 = objFSO.GetParentFolderName(shortcutTarget32)


If objFSO.FolderExists(StartupPath32) then
Shortcut32.WorkingDirectory = StartupPath32
End If

Shortcut32.Save

Michael J


0

Response Number 4
Name: Derek
Date: March 4, 2008 at 20:08:33 Pacific
Reply:

I don't know the background to your request but another way is to create a shortcut inside a Windows Explorer folder, then use a batch file to place that shortcut on the desktop when required.

some other bloke...


0

Sponsored Link
Ads by Google
Reply to Message Icon

Related Posts

See More







Post Locked

This post is quite old and has been locked from receiving new replies. Please create a new posting instead.


Go to Windows XP Forum Home


Sponsored links

Ads by Google


Results for: Script to create shortcut

Script to create new folder week www.computing.net/answers/windows-xp/script-to-create-new-folder-week/141583.html

Need a script to create ASX files www.computing.net/answers/windows-xp/need-a-script-to-create-asx-files/143293.html

How2?-Create shortcut 4 Ctl+Alt+Del www.computing.net/answers/windows-xp/how2create-shortcut-4-ctlaltdel/13684.html