Archive: CreateShortCut for All Users


Hey there,

Does anyone know an easy way to create a shortcut under the "All Users" folder in WinNT/2K instead of the users' own start menu? The builtin $STARTMENU replacable parameters point to the users' own start menu.

Thanks,
Aarif


As far as I can see NSIS needs to add variables for these items as I have suggested in the past...

This is what the VB script "SpecialFolders" returns:

The following special folders are provided with the Windows 95 and Microsoft Windows NT 4.0 operating systems:

AllUsersDesktop
AllUsersStartMenu
AllUsersPrograms
AllUsersStartup
Desktop
Favorites
Fonts
MyDocuments
NetHood
PrintHood
Programs
Recent
SendTo
StartMenu
Startup
Templates

These should probably be the minimum available and probably with these names as Microsoft selected them.

As I already have a site of my own with over 100 of my own free downloads I don't have time myself to do these things... But if someone does PLEASE ADD "COMSPEC" and preferably generic access to environment variables...


hi,
dbareis,

don't panic ;)

use this function until it is implemented in nsis
(will it ?)

;==============================
Function GetShellFolderPath
;==============================

;possible values for 'folder_name':
;Desktop, Personal, NetHood, PrintHood, Programs,
;'Start Menu', AppData,SendTo, Cache, Cookies, History,
;Favorites, Startup, Recent, Templates,'Local AppData',
;Fonts, 'My Music', 'My Video', 'My Pictures'
;(if the list is incomplete please post back)

StrCpy $0 "folder_name"

ClearErrors
ReadRegStr $1 HKCU \
"SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\Shell Folders" "$0"

IfErrors lbl_na lbl_ok

lbl_na:
MessageBox MB_OK "ShellFolder-Path is not available!"
GoTo lbl_end

lbl_ok:
StrCmp $1 "" lbl_na
MessageBox MB_OK "$1"

lbl_end:
;------------------------------
FunctionEnd
;------------------------------

cu yzo


Good workaround, it would be nice if all the handy little snippets were collected somewhere!


Isn't TheMIKE working on collecting all these snippets?


hi,

i have set up a functions archive (currently 7 functions of myself which are included with PowerPiMPiT) on my page (click on Functions Included), feel free to visit/contribute to it.

cu yzo