Page 1 of 1 1
Topic Options
#141524 - 2005-06-14 02:16 AM kix file assoc - a basic one
Lonkero Administrator Offline
KiX Master Guru
*****

Registered: 2001-06-05
Posts: 22346
Loc: OK
my green friend needed an easy way to access tokenizing and all that stuff, so I wrote him a basic script...
Code:
$kixfile=readvalue("HKEY_CLASSES_ROOT\.kix","")
if not len($kixfile) $kixfile = "KiXfile" endif
$KXfile=readvalue("HKEY_CLASSES_ROOT\.kx","")
if not len($KXfile) $KXfile = "KXfile" endif
if not exist('%windir%\system32\'+@scriptexe)
copy @scriptdir+'\'+@scriptexe '%windir%\system32\'+@scriptexe
endif
if not len(readvalue("HKEY_CLASSES_ROOT\"+$KXfile,""))
$=writevalue("HKEY_CLASSES_ROOT\"+$KXfile,"","KiXtart KX File","REG_SZ")
endif
if not len(readvalue("HKEY_CLASSES_ROOT\"+$KXfile+"\DefaultIcon",""))
$=writevalue("HKEY_CLASSES_ROOT\"+$KXfile+"\DefaultIcon","","%SystemRoot%\system32\SHELL32.dll,76","REG_SZ")
endif
if not len(readvalue("HKEY_CLASSES_ROOT\"+$KXfile+"\shell",""))
$=writevalue("HKEY_CLASSES_ROOT\"+$KXfile+"\shell","","Open","REG_SZ")
endif
if not len(readvalue("HKEY_CLASSES_ROOT\"+$KXfile+"\shell\Open\command",""))
$=writevalue("HKEY_CLASSES_ROOT\"+$KXfile+"\shell\Open\command","",'"%windir%\system32\'+@scriptexe+'" "%%1"',"REG_SZ")
endif
if not len(readvalue("HKEY_CLASSES_ROOT\"+$kixfile,""))
$=writevalue("HKEY_CLASSES_ROOT\"+$kixfile,"","KiXtart Script File","REG_SZ")
endif
if not len(readvalue("HKEY_CLASSES_ROOT\"+$kixfile+"\DefaultIcon",""))
$=writevalue("HKEY_CLASSES_ROOT\"+$kixfile+"\DefaultIcon","","%SystemRoot%\system32\SHELL32.dll,72","REG_SZ")
endif
if not len(readvalue("HKEY_CLASSES_ROOT\"+$kixfile+"\shell",""))
$=writevalue("HKEY_CLASSES_ROOT\"+kixfile+"\shell","","Open","REG_SZ")
endif
if not len(readvalue("HKEY_CLASSES_ROOT\"+kixfile+"\shell\Open\command",""))
$=writevalue("HKEY_CLASSES_ROOT\"+kixfile+"\shell\Open\command","",'"%windir%\system32\'+@scriptexe+'" "%%1"',"REG_SZ")
endif
if not len(readvalue("HKEY_CLASSES_ROOT\"+kixfile+"\shell\Edit\command",""))
$=writevalue("HKEY_CLASSES_ROOT\"+kixfile+"\shell\Edit\command","",'"%windir%\system32\notepad.exe" "%%1"',"REG_SZ")
endif
if not len(readvalue("HKEY_CLASSES_ROOT\"+kixfile+"\shell\Tokenize\command",""))
$=writevalue("HKEY_CLASSES_ROOT\"+kixfile+"\shell\Tokenize\command","",'"%windir%\system32\'+@scriptexe+'" "%%1" /t',"REG_SZ")
endif
if not len(readvalue("HKEY_CLASSES_ROOT\"+kixfile+"\shell\Debug\command",""))
$=writevalue("HKEY_CLASSES_ROOT\"+kixfile+"\shell\Debug\command","",'"%windir%\system32\'+@scriptexe+'" "%%1" /d',"REG_SZ")
endif



Edited by Lonkero (2005-06-14 03:55 AM)
_________________________
!

download KiXnet

Top
#141525 - 2005-06-14 02:46 AM Re: kix file assoc - a basic one
Jose Offline
Seasoned Scripter
*****

Registered: 2001-04-04
Posts: 693
Loc: Buenos Aires - Argentina
Good way Jooel, tomorrow I give a next try.
_________________________
Life is fine.

Top
#141526 - 2005-06-14 02:57 AM Re: kix file assoc - a basic one
Jose Offline
Seasoned Scripter
*****

Registered: 2001-04-04
Posts: 693
Loc: Buenos Aires - Argentina
BTW? Woudnt be nice if the hole KiXtart package comes as an exe (compressed) file that do the stuff?
I mean copy Wkix32.exe to System32 and run FileAssoc.kix that you wrote for ppl to just run it in order to use it, and place the normal extracted files to the same folder.
Your thought jlo?
gnight man.
_________________________
Life is fine.

Top
#141527 - 2005-06-14 03:05 AM Re: kix file assoc - a basic one
Les Offline
KiX Master
*****

Registered: 2001-06-11
Posts: 12734
Loc: fortfrances.on.ca
You didn't ask my opinion but I will give it anyway. I prefer KiX not to have any file associations whatsoever. What is wrong with just calling KiX and passing parms? If you want associations, you can run a script. If you want KiX locally installed, you can copy it. It should not be the default.
_________________________
Give a man a fish and he will be back for more. Slap him with a fish and he will go away forever.

Top
#141528 - 2005-06-14 03:15 AM Re: kix file assoc - a basic one
NTDOC Administrator Offline
Administrator
*****

Registered: 2000-07-28
Posts: 11629
Loc: CA
I agree with Les. No automated VBSCRIPT type junk for me thanks.
Top
#141529 - 2005-06-14 03:25 AM Re: kix file assoc - a basic one
Lonkero Administrator Offline
KiX Master Guru
*****

Registered: 2001-06-05
Posts: 22346
Loc: OK
lol...
no, vbscript has good parts too.
it's there.
you go coding anywhere in MS world and vbscript is always accepted.
kix is totally another matter.
if you want to use it, you always need for forge it.
not best solution I say.

but, on the other hand. as Ruud has not to this date got stdout and stdin working, what can we expect more?
_________________________
!

download KiXnet

Top
#141530 - 2005-06-14 03:33 AM Re: kix file assoc - a basic one
NTDOC Administrator Offline
Administrator
*****

Registered: 2000-07-28
Posts: 11629
Loc: CA
Associations are for the noobie GUI click happy people that don't know how to launch something on their own.

Can't believe I even see such from LINUX command-line basta


Top
#141531 - 2005-06-14 03:54 AM Re: kix file assoc - a basic one
Lonkero Administrator Offline
KiX Master Guru
*****

Registered: 2001-06-05
Posts: 22346
Loc: OK
the point is, if you need to have gui, why don't you use it?

btw, added debug item in the above too
_________________________
!

download KiXnet

Top
#141532 - 2005-06-14 03:56 AM Re: kix file assoc - a basic one
Lonkero Administrator Offline
KiX Master Guru
*****

Registered: 2001-06-05
Posts: 22346
Loc: OK
oh, and don't try anything older than 4.50 rc-1.
at least 4.50 beta2 seems to have issues with scriptexe...
_________________________
!

download KiXnet

Top
#141533 - 2005-06-14 06:18 AM Re: kix file assoc - a basic one
Kdyer Offline
KiX Supporter
*****

Registered: 2001-01-03
Posts: 6241
Loc: Tigard, OR
Quote:

Associations are for the noobie GUI click happy people that don't know how to launch something on their own.

Can't believe I even see such from LINUX command-line basta





Doc - I agree to a point. If it is you developing the script then it is fine, but for the user populus - no way. I remember, MCA did an association with his KiXStrip/KiXRef programs too.

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

Top
#141534 - 2005-06-14 06:25 AM Re: kix file assoc - a basic one
NTDOC Administrator Offline
Administrator
*****

Registered: 2000-07-28
Posts: 11629
Loc: CA
No problem - to each his own. Again that's the beauty of the PC I think... you have a choice for most things.

I choose not to associate, but for those that want it... there you go - Silver Platter code.
 

Top
#141535 - 2005-06-14 06:51 AM Re: kix file assoc - a basic one
Lonkero Administrator Offline
KiX Master Guru
*****

Registered: 2001-06-05
Posts: 22346
Loc: OK
ja...
mca's assocs had always some issue with not being compatible with wkix32.
I did this mainly because I use wkix32.
I don't want to see console if I don't tell it to appear from the script.
now, with kix commandline centric thinking, I would always debug from commandline even though kixtart opens new window for it.
I would always need to launch tokenizing from commandline even though I have no other business.
and then, I would always need to do series of cd commands and in some cases even a drive change.
that's so painfull when everything can be automated with simple assoc.

nowadays, there is virtually no reason for me to launch "cmd" unless I do some pinging or nslookup.
for all other stuff, notepad and file assocs will do
and ie and...

what comes to me being a commandline basta.
well, not so much.
I'm one of those guys that don't even install linux before they are sure they get KDE running smootly.
and it must boot into gui mode.
that said, I always aim for the efficient and simple way, as I thought all lazy ppl do.
and file assocs suite that picture.
_________________________
!

download KiXnet

Top
#141536 - 2005-06-14 06:52 AM Re: kix file assoc - a basic one
Lonkero Administrator Offline
KiX Master Guru
*****

Registered: 2001-06-05
Posts: 22346
Loc: OK
wow... don't remember when last time I wrote that long poem.
freaking awesome.
_________________________
!

download KiXnet

Top
#141537 - 2005-06-14 06:53 AM Re: kix file assoc - a basic one
NTDOC Administrator Offline
Administrator
*****

Registered: 2000-07-28
Posts: 11629
Loc: CA
ROFLMAO

Well I'll be dipped in pig ^&%$

Would never have thought that Lonk.

Oh well, as long as it works the way you like, that's what counts.

 

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 1376 anonymous users online.
Newest Members
batdk82, StuTheCoder, M_Moore, BeeEm, min_seow
17885 Registered Users

Generated in 0.068 seconds in which 0.028 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