Page 1 of 1 1
Topic Options
#64467 - 2002-04-11 03:36 PM Read desk top
Saleem Offline
Hey THIS is FUN
*

Registered: 2001-04-11
Posts: 280
Loc: UAE
Gretings to all [Smile]

Just a (may be) simple question
I wana read the target of an icon in the desktop and want to change the path.
Example if msword.exe is pointing to \\server1\programs\msword.exe I wana change to \\server2\progrmas\msword.exe
I am running kix 3.63, Any idea ??

Saleem
_________________________
“I’ll not change you unless you don’t have intention to change yourself” --H:Quran

Top
#64468 - 2002-04-11 03:37 PM Re: Read desk top
Lonkero Administrator Offline
KiX Master Guru
*****

Registered: 2001-06-05
Posts: 22346
Loc: OK
can't you just replace the icon with new link file?
_________________________
!

download KiXnet

Top
#64469 - 2002-04-11 03:58 PM Re: Read desk top
Saleem Offline
Hey THIS is FUN
*

Registered: 2001-04-11
Posts: 280
Loc: UAE
I can but I have to check that icon is there or not if old one exist on the desktop I can replace it, But how to check the old one ?
_________________________
“I’ll not change you unless you don’t have intention to change yourself” --H:Quran

Top
#64470 - 2002-04-11 04:26 PM Re: Read desk top
Breaker Offline
Hey THIS is FUN
*****

Registered: 2001-06-15
Posts: 268
Loc: Yorkshire, England
Would this not work:

code:
If exist("%USERPROFILE%\Desktop\MS Word.lnk")
shell "cmd.exe /c copy msword.lnk %USERPROFILE%\Desktop\msword.lnk"
Endif

I mean, that's just a guess. I think I've seen the %USERPROFILE% env variable used elsewhere, but it ought to be OK.

Someone slap me if I'm talking rubbish, because this is completely untested.
_________________________
================================================
Breaker


Top
#64471 - 2002-04-11 04:27 PM Re: Read desk top
Lonkero Administrator Offline
KiX Master Guru
*****

Registered: 2001-06-05
Posts: 22346
Loc: OK
you could check for it's age or difference to the new one and first of all does it exist.
to check what shortcuts do is not possible on normal lnk-files. then there is as an example url-links which can be used as normal linkfiles and their format is pure ini.

cheers,
_________________________
!

download KiXnet

Top
#64472 - 2002-04-11 04:30 PM Re: Read desk top
Lonkero Administrator Offline
KiX Master Guru
*****

Registered: 2001-06-05
Posts: 22346
Loc: OK
breaker, ok but not functional on all systems.
desktop folder information needs to red from registry to be sure.

then just replacing would not seem to be enough.
_________________________
!

download KiXnet

Top
#64473 - 2002-04-11 04:31 PM Re: Read desk top
Breaker Offline
Hey THIS is FUN
*****

Registered: 2001-06-15
Posts: 268
Loc: Yorkshire, England
Just checked. The %USERPROFILE% env variable is perfectly valid, but now that I actually think about it, you'd need to do a bit more checking, in case people have different names for the Word shortcut. But you could enumerate all the shortcuts and files on the desktop, looking for the string "word", I guess.

Hasn't Shawn posted a UDF that allows some manipulation of shortcuts?
_________________________
================================================
Breaker


Top
#64474 - 2002-04-11 04:39 PM Re: Read desk top
Breaker Offline
Hey THIS is FUN
*****

Registered: 2001-06-15
Posts: 268
Loc: Yorkshire, England
You should look here for a more thorough discussion of this subject.

WshShortCut UDF posted by Shawn

Hope this helps!
_________________________
================================================
Breaker


Top
#64475 - 2002-04-11 06:10 PM Re: Read desk top
Saleem Offline
Hey THIS is FUN
*

Registered: 2001-04-11
Posts: 280
Loc: UAE
Thanx for reply guys..
Breaker: As you doubt shortcut name could be changed by users

I am using kix 3.64 I doubt WSH function will work on it or not. [Frown]
_________________________
“I’ll not change you unless you don’t have intention to change yourself” --H:Quran

Top
#64476 - 2002-04-11 06:58 PM Re: Read desk top
Les Offline
KiX Master
*****

Registered: 2001-06-11
Posts: 12734
Loc: fortfrances.on.ca
If you drag/drop a shotcut onto NotePad, you will see the target is in plain text. With that in mind, you could use any one of a number of grep-like file search utils (or even code it in KiX) to search for the old target. Then making a new shortcut is just a matter of using any one of a number of utils or UDFs.
_________________________
Give a man a fish and he will be back for more. Slap him with a fish and he will go away forever.

Top
#64477 - 2002-04-17 12:23 AM Re: Read desk top
Lonkero Administrator Offline
KiX Master Guru
*****

Registered: 2001-06-05
Posts: 22346
Loc: OK
breaker, still, as you said that %userprofile% is valid. sure it is.
but %userprofile%\desktop-assumption isn't!

desktop-folder varies depending of the system language and os type.

valid desktop path is still in the registry.

cheers,
_________________________
!

download KiXnet

Top
#64478 - 2002-04-16 02:15 PM Re: Read desk top
Kdyer Offline
KiX Supporter
*****

Registered: 2001-01-03
Posts: 6241
Loc: Tigard, OR
To establish the desktop location, you can do a readvalue on -

For the user:
HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\Shell Folders
"Desktop"

For all users:
HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\explorer\Shell Folders
Under 9x, this one is called "Common Desktop"

HTH,

- Kent

[ 16 April 2002, 14:15: Message edited by: kdyer ]
_________________________
Utilize these resources:
UDFs (Full List)
KiXtart FAQ & How to's

Top
Page 1 of 1 1


Moderator:  Glenn Barnas, NTDOC, Arend_, Jochen, Radimus, Allen, ShaneEP, Ruud van Velsen, 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.067 seconds in which 0.03 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