Page 1 of 1 1
Topic Options
#145062 - 2005-08-09 11:29 AM Creating a Shortcut On To A Desktop
Orion Offline
Fresh Scripter

Registered: 2005-08-09
Posts: 10
Loc: London, UK
Hi Guys

I saw that ripping that Oscar got for not enough details so here goes

I'm using KiXtart to run a logon script for the users on our domain. The users are running Windows 2000 and XP. The server is Windows Server 2003.

I have seen KiXtart working as a logon script and its great.

Anyway I would like the logon script to create a shortcut on the desktop and display a welcome message. I have looked through the KiXtart manual and found it great if you know what to do but... well i don't .

Also have you seen any articles or websites that could help with the basics.

Thanks you in advance.

Russell
_________________________
"We ride together, We die together, Bad boys for life" - Will Smith "Don't run, you'll only die tired" "When did I realize I was God? Well, I was praying and I suddenly realized I was talking to myself" - Peter O'Toole. Remember; The Arc was built by amateurs but the Titanic was built by professionals.

Top
#145063 - 2005-08-09 11:44 AM Re: Creating a Shortcut On To A Desktop
NTDOC Administrator Offline
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
#145064 - 2005-08-09 11:51 AM Re: Creating a Shortcut On To A Desktop
Orion Offline
Fresh Scripter

Registered: 2005-08-09
Posts: 10
Loc: London, UK
Wow thanks for that. If only my local chinese was that quick
_________________________
"We ride together, We die together, Bad boys for life" - Will Smith "Don't run, you'll only die tired" "When did I realize I was God? Well, I was praying and I suddenly realized I was talking to myself" - Peter O'Toole. Remember; The Arc was built by amateurs but the Titanic was built by professionals.

Top
#145065 - 2005-08-09 12:10 PM Re: Creating a Shortcut On To A Desktop
Orion Offline
Fresh Scripter

Registered: 2005-08-09
Posts: 10
Loc: London, UK
Quote:

Please review the actual UDF for details on usage.



Sorry whats UDF?
_________________________
"We ride together, We die together, Bad boys for life" - Will Smith "Don't run, you'll only die tired" "When did I realize I was God? Well, I was praying and I suddenly realized I was talking to myself" - Peter O'Toole. Remember; The Arc was built by amateurs but the Titanic was built by professionals.

Top
#145066 - 2005-08-09 12:50 PM Re: Creating a Shortcut On To A Desktop
Mart Moderator Offline
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
#145067 - 2005-08-09 12:59 PM Re: Creating a Shortcut On To A Desktop
Lonkero Administrator Offline
KiX Master Guru
*****

Registered: 2001-06-05
Posts: 22346
Loc: OK
User Defined Function,
coded in between function and endfunction keywords to denote a script that does a specific purpose job.
UDF works just as kixtart inbuilt functions with the difference that user has made them and thus you need to incorporate the UDF source in your script as well.
more of udfs:
http://www.kixtart.org/ubbthreads/showflat.php?Cat=0&Number=81594
_________________________
!

download KiXnet

Top
#145068 - 2005-08-09 01:01 PM Re: Creating a Shortcut On To A Desktop
Lonkero Administrator Offline
KiX Master Guru
*****

Registered: 2001-06-05
Posts: 22346
Loc: OK
damn, you only 9 minutes faster... how can I be so slow.
_________________________
!

download KiXnet

Top
#145069 - 2005-08-09 01:14 PM Re: Creating a Shortcut On To A Desktop
Mart Moderator Offline
KiX Supporter
*****

Registered: 2002-03-27
Posts: 4673
Loc: The Netherlands
LOL
Maybe you should get some sleep or vodka to get you going again
_________________________
Mart

- Chuck Norris once sold ebay to ebay on ebay.

Top
#145070 - 2005-08-09 02:39 PM Re: Creating a Shortcut On To A Desktop
Orion Offline
Fresh Scripter

Registered: 2005-08-09
Posts: 10
Loc: London, UK
Thanks a million.
_________________________
"We ride together, We die together, Bad boys for life" - Will Smith "Don't run, you'll only die tired" "When did I realize I was God? Well, I was praying and I suddenly realized I was talking to myself" - Peter O'Toole. Remember; The Arc was built by amateurs but the Titanic was built by professionals.

Top
Page 1 of 1 1


Moderator:  Jochen, Allen, Radimus, Glenn Barnas, ShaneEP, Ruud van Velsen, Arend_, Mart 
Hop to:
Shout Box

Who's Online
0 registered and 2220 anonymous users online.
Newest Members
Viginette, ManuvdWielNL, Sir_Barrington, batdk82, StuTheCoder
17888 Registered Users

Generated in 0.068 seconds in which 0.031 seconds were spent on a total of 12 queries. Zlib compression enabled.

Search the board with:
superb Board Search
or try with google:
Google
Web kixtart.org