Page 1 of 1 1
Topic Options
#122791 - 2004-07-13 02:26 PM Associating icons with desktop shortcuts
rhipkin Offline
Lurker

Registered: 2004-07-13
Posts: 2
Loc: South Africa
Good day,

You will have to excuse me I am completely new to scripting and I have been assigned a task to place an Intranet shortcut on all users desktops, this I have managed to do due to the fact the previous IT chap had already written that part of the script. The thing is I now need to associate the specifically create icon to that shortcut(as it is the default windows icon), this is the script written to place the shortcut on the desktop:

Select
Case @INWIN = 1
Copy "\\" + $Logonsvr + "\NETLOGON\RDSInt~1.URL" %SystemDrive% + "\DOCUME~1\ALLUSE~1\DESKTOP"
Case @INWIN = 2
Copy "\\" + $Logonsvr + "\NETLOGON\RDSInt~1.URL" %WinBootDir% + "\DESKTOP"
EndSelect

Select
Case @INWIN = 1
Copy "\\" + $Logonsvr + "\NETLOGON\RDSInt~1.URL" %SystemDrive% + "\DOCUME~1\ALLUSE~1\Startm~1\Programs\startup"
Case @INWIN = 2
Copy "\\" + $Logonsvr + "\NETLOGON\RDSInt~1.URL" %WinBootDir% + "\Windows\Alluse~1\Startm~1\Programs\Startup"

EndSelect

How can I go about associating an icon with the shortcuts?

Top
#122792 - 2004-07-13 02:29 PM Re: Associating icons with desktop shortcuts
Lonkero Administrator Offline
KiX Master Guru
*****

Registered: 2001-06-05
Posts: 22346
Loc: OK
you are already copying the shortcut.
so, what you should do, is edit the original server side shortcut to have the correct icon.
it will then have it on client too.
_________________________
!

download KiXnet

Top
#122793 - 2004-07-13 02:37 PM Re: Associating icons with desktop shortcuts
Chris S. Offline
MM club member
*****

Registered: 2002-03-18
Posts: 2368
Loc: Earth
Quote:

so, what you should do, is edit the original server side shortcut to have the correct icon.




This may mean copying the .ico file to the local PC as well.

Top
#122794 - 2004-07-13 02:43 PM Re: Associating icons with desktop shortcuts
Lonkero Administrator Offline
KiX Master Guru
*****

Registered: 2001-06-05
Posts: 22346
Loc: OK
or, if using icon of some system file, being carefull.
_________________________
!

download KiXnet

Top
#122795 - 2004-07-13 02:44 PM Re: Associating icons with desktop shortcuts
Kdyer Offline
KiX Supporter
*****

Registered: 2001-01-03
Posts: 6241
Loc: Tigard, OR
I still don't see why you need to copy the Icon to the desktop for a web .URL file.

Code:

IF NOT EXIST($desktop+'\website.url')
$rc=writeprofilestring($desktop+'\website.url','InternetShortcut','http://yoursite.com')
ELSE
IF READPROFILESTRING($desktop+'\website.url','InternetShortcut')<>http://yoursite.com'
$rc=writeprofilestring($desktop+'\website.url','InternetShortcut','http://yoursite.com')
ENDIF
ENDIF



Thanks,

Kent
_________________________
Utilize these resources:
UDFs (Full List)
KiXtart FAQ & How to's

Top
#122796 - 2004-07-13 02:51 PM Re: Associating icons with desktop shortcuts
Lonkero Administrator Offline
KiX Master Guru
*****

Registered: 2001-06-05
Posts: 22346
Loc: OK
no need to copy ico to desktop anyways.
but if you want the show nice icon, you need to have the icon and shortcuts can't really "hold" an icon, they can only reference them.
_________________________
!

download KiXnet

Top
#122797 - 2004-07-13 02:53 PM Re: Associating icons with desktop shortcuts
Chris S. Offline
MM club member
*****

Registered: 2002-03-18
Posts: 2368
Loc: Earth
Quote:

I still don't see why you need to copy the Icon to the desktop for a web .URL file.




You don't necessarily have to, but it works better if the user is offline. Seems like some URLs hold their icon better if the .ico is local as well.

Top
#122798 - 2004-07-13 02:58 PM Re: Associating icons with desktop shortcuts
Kdyer Offline
KiX Supporter
*****

Registered: 2001-01-03
Posts: 6241
Loc: Tigard, OR
Then WSHSHORTCUT() UDF would be helpful.

Kent
_________________________
Utilize these resources:
UDFs (Full List)
KiXtart FAQ & How to's

Top
#122799 - 2004-07-13 03:05 PM Re: Associating icons with desktop shortcuts
Lonkero Administrator Offline
KiX Master Guru
*****

Registered: 2001-06-05
Posts: 22346
Loc: OK
sure, it would.
so, now it's mentioned.

would you also mention the implementation of the UDF
_________________________
!

download KiXnet

Top
#122800 - 2004-07-13 03:07 PM Re: Associating icons with desktop shortcuts
rhipkin Offline
Lurker

Registered: 2004-07-13
Posts: 2
Loc: South Africa
I thank you all for the quick response...wow! I have copied the icon to the local machines via login script as well, as well as associating the server url shortcut with the icon, but the shortcut is placed minus the icon. Guess I will just keep on trying
Top
#122801 - 2004-07-13 03:14 PM Re: Associating icons with desktop shortcuts
Radimus Moderator Offline
Moderator
*****

Registered: 2000-01-06
Posts: 5187
Loc: Tampa, FL
IF NOT EXIST($desktop+'\website.url')
$=writeprofilestring($desktop+'\website.url','InternetShortcut','URL','http://www.kixtart.org/')
$=writeprofilestring($desktop+'\website.url','InternetShortcut','IconFile','%windir%\website.ico')
$=writeprofilestring($desktop+'\website.url','InternetShortcut','IconIndex','0')
endif
_________________________
How to ask questions the smart way <-----------> Before you ask

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
1 registered (Henriques) and 2516 anonymous users online.
Newest Members
fgarcia, Viginette, ManuvdWielNL, Sir_Barrington, batdk82
17889 Registered Users

Generated in 0.105 seconds in which 0.071 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