#145063 - 2005-08-09 11:44 AM
Re: Creating a Shortcut On To A Desktop
|
NTDOC
Administrator
   
Registered: 2000-07-28
Posts: 11634
Loc: Space
|
Hello Orion and welcome to the board.
Here is some example code to do a desktop shortcut. Please review the actual UDF for details on usage.
Code:
Break On Dim $SO $SO=SetOption('Explicit','On') $SO=SetOption('NoVarsInStrings','On') $SO=SetOption('WrapAtEOL','On') Dim $HKCUSMWCV,$Desktop $HKCUSMWCV = 'HKCU\Software\Microsoft\Windows\CurrentVersion' $Desktop = ReadValue($HKCUSMWCV+'\Explorer\Shell Folders','Desktop') WshShortCut($Desktop + "\KiXtart Forum.url","http://www.kixtart.org/ubbthreads/ubbthreads.php?Cat=") Function WshShortCut( $path, $targetpath, optional $arguments,$startdir,$iconpath,$style) Dim $shell,$shortcut $shell = CreateObject('wscript.shell') If $shell $shortcut = $shell.createshortcut($path) If $shortcut $shortcut.targetpath = $targetpath If $arguments $shortcut.arguments = $arguments Endif If $startdir $shortcut.workingdirectory = $startdir Endif If $iconpath $shortcut.iconlocation = $iconpath Endif If $style $shortcut.windowstyle = $style Endif $shortcut.save $shortcut = 0 Endif $shell = 0 Endif Exit @error EndFunction
Please search the board as there are MANY posts about doing shortcuts and there are also numerous posts about displaying information during logon.
Lonkero even posted a nifty way of doing the shortcut without the UDF recently.
|
|
Top
|
|
|
|
#145066 - 2005-08-09 12:50 PM
Re: Creating a Shortcut On To A Desktop
|
Mart
KiX Supporter
   
Registered: 2002-03-27
Posts: 4673
Loc: The Netherlands
|
UDF's are User Defined Functions. They add functionality to the kix32.exe that is not and does not have to be embedded into kix32.exe. Users of kix created them for "special tasks". There is a special section on this board for them here. Each UDF has some explanations about the way to use them and what they do at the top of the UDF. We did the shortcuts by using WSHShortcut() found here.
It creates shortcut to programs (files) and/or WebPages like this:
Code:
Call @SCRIPTDIR +"\wshShortCut().udf"
$=wshShortcut("KiXtart Web Page","http://www.kixtart.org") ;creates a shortcut to this board. $=wshShortcut("Notepad","%systemroot%\system32\notepad.exe") ;creates a shortcut to notepad.
Off course you will need to put the code from the wshsortcut udf link above in the file wshshortcut().udf in the same dir as the script you are calling it from in this example.
Edited by Mart (2005-08-09 12:53 PM)
|
|
Top
|
|
|
|
Moderator: Jochen, Allen, Radimus, Glenn Barnas, ShaneEP, Ruud van Velsen, Arend_, Mart
|
0 registered
and 2220 anonymous users online.
|
|
|