You should use inf method or AutoIt, because these methods use dir id's (inf) or macros for folders (AutoIt), for example @DesktopCommonDir instead of C:\Users\Public\Desktop
AutoIt method (on the top of .au3 file, you can add command to install Office 2003 silently):
FileCreateShortcut(@ProgramFilesDir & "\Microsoft Office\Office11\WINWORD.EXE", @DesktopCommonDir & "\Word 2003.lnk", @ProgramFilesDir & "\Microsoft Office\Office11", "", "Create beautiful documents, easily work with others, and enjoy the read.")
FileCreateShortcut(@ProgramFilesDir & "\Microsoft Office\Office11\EXCEL.EXE", @DesktopCommonDir & "\Excel 2003.lnk", @ProgramFilesDir & "\Microsoft Office\Office11", "", "Easily discover, visualize, and share insights from your data.")
Inf method:
Use 3 files: install.cmd, create_shortcut_x86.inf and create_shortcut_x64.inf
install.cmd content (on the top of install.cmd file, you can add command to install Office 2003 silently):
@ECHO OFF
:: Check the operating system type (32 bit or 64 bit)
IF NOT EXIST %SystemRoot%\SysWOW64 GOTO X86
IF EXIST %SystemRoot%\SysWOW64 GOTO X64
:: 32 bit
:X86
::Create All Users Desktop icons for Word 2003 and Excel 2003 on 32 bit operating systems
start rundll32.exe advpack.dll,LaunchINFSection create_shortcut_x86.inf,,1
:: 64 bit
:X64
::Create All Users Desktop icons for Word 2003 and Excel 2003 on 64 bit operating systems
start rundll32.exe advpack.dll,LaunchINFSection create_shortcut_x64.inf,,1
:END
EXIT
create_shortcut_x86.inf content:
[Version]
Signature=$Windows NT$
[DefaultInstall]
ProfileItems=1IconItemAdd
ProfileItems=2IconItemAdd
[1IconItemAdd]
; All Users Desktop icon for MSO Word 2003
Name = "Word 2003", 0x0000008, 16409
CmdLine = 16422,"Microsoft Office\Office11","WINWORD.EXE"
WorkingDir = 16422,"Microsoft Office\Office11"
InfoTip = "Create beautiful documents, easily work with others, and enjoy the read."
[2IconItemAdd]
; All Users Desktop icon for MSO Excel 2003
Name = "Excel 2003", 0x0000008, 16409
CmdLine = 16422,"Microsoft Office\Office11","EXCEL.EXE"
WorkingDir = 16422,"Microsoft Office\Office11"
InfoTip = "Easily discover, visualize, and share insights from your data."
create_shortcut_x64.inf content:
[Version]
Signature=$Windows NT$
[DefaultInstall]
ProfileItems=1IconItemAdd
ProfileItems=2IconItemAdd
[1IconItemAdd]
; All Users Desktop icon for MSO Word 2003
Name = "Word 2003", 0x0000008, 16409
CmdLine = 16426,"Microsoft Office\Office11","WINWORD.EXE"
WorkingDir = 16426,"Microsoft Office\Office11"
InfoTip = "Create beautiful documents, easily work with others, and enjoy the read."
[2IconItemAdd]
; All Users Desktop icon for MSO Excel 2003
Name = "Excel 2003", 0x0000008, 16409
CmdLine = 16426,"Microsoft Office\Office11","EXCEL.EXE"
WorkingDir = 16426,"Microsoft Office\Office11"
InfoTip = "Easily discover, visualize, and share insights from your data."
More info regarding shortcut creation using inf
here
This post has been edited by radix: 16 February 2013 - 09:53 AM