Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Getting the P&D Wizard to put a shortcut on the desktop? 2

Status
Not open for further replies.

jbradley

Programmer
Sep 7, 2001
248
US
Is there any way to build an installation package using the Package & Deployment Wizard that comes with VB6 to place a shortcut on the All Users desktop instead of in the logged in user's Start menu on an NT system?
 
as far as i know, the answer is "no"

that has to be done by the NT people
or of u wanna do it yourself, put a copy of the shortcut in the profile/all users folder

Sam
 
P&D doesn't have this functionality. Install sheild could do it for you. Craig, mailto:sander@cogeco.ca

Remember not to name the Lambs...
It only makes the chops harder to swallow
 
You can do this with P&D.
You need to change the SetUp1.Vbp

This isn't done normally in the P&D because MS says that's not the proper way to do it in NT [Hammer]
 
Neet Clint.

How do you change it in the Setup1. I couldn't find anything on this. Craig, mailto:sander@cogeco.ca

Remember not to name the Lambs...
It only makes the chops harder to swallow
 
Craig,
See my posts in thread222-246643
Good Luck
------------
Select * from Users where Clue > 0
0 rows returned
 
Cool thanks. This will be very helpful. Craig, mailto:sander@cogeco.ca

Remember not to name the Lambs...
It only makes the chops harder to swallow
 
Here is the code that will place an item on the desktop

You will need to include the following reference into the project:

Windows Script Host Object Model

'-------

Sub fCreateShortcutOnDesktop()

Dim WSHShell As IWshRuntimeLibrary.IWshShell_Class
Dim WSHShortcut As IWshRuntimeLibrary.IWshShortcut_Class
Dim strFullFilePathName As String
Dim strDesktopPath As String
Dim strFileName As String
Dim strPath As String

' Create a Windows Shell Object
Set WSHShell = New IWshRuntimeLibrary.IWshShell_Class

' Set the file's name and path...

strPath = "C:\vb_projs\LineCount\"
strFileName = "LineCount" ' Note without .exe
strFullFilePathName = strPath + strFileName

' Read desktop path using WshSpecialFolders object
strDesktopPath = WSHShell.SpecialFolders.Item("Desktop")

' Create a shortcut object on the desktop
Set WSHShortcut = WSHShell.CreateShortcut(strDesktopPath & "\" & strFileName & ".lnk")

' Set shortcut object properties and save it
With WSHShortcut
.TargetPath = WSHShell.ExpandEnvironmentStrings(strFullFilePathName)
.WorkingDirectory = WSHShell.ExpandEnvironmentStrings(strPath)
.WindowStyle = 4
.Save
End With
fCreateShortcutOnDesktop = 1

Set WSHShell = Nothing

End Sub

'===============

I'll leave the error handling code up to you

To have this done by the PDW, place this subroutine in the Setup1 project of the PDW and call it at the right time.

See my posts in Thread222-246643 for suggestions on modifying the Setup1 project of the PDW


Good Luck
------------
Select * from Users where Clue > 0
0 rows returned
 
Thanks! I'll give it a try and let you know how it works.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top