Page 1 of 1 1
Topic Options
#109847 - 2003-12-08 07:27 PM How-TO: Run KiXtart scripts via LPO/GPO
Sealeopard Offline
KiX Master
*****

Registered: 2001-04-25
Posts: 11164
Loc: Boston, MA, USA
By default, Windows LPO/GPOs do not run KiXtart scripts as e.g. startup/shutdown/logon/logoff scripts. Scripts are limited to Windows Scripting Host registered script extensions such as .WSH, .JS or Perl/PHP extensions if the appropriate AxtiveX scripting engine is installed. Kixtart does not offer this ActiveX integration into WSH. A standard workaround is to assign a batch file to the script to be launched via LPO/GPO.

However, there is a way to directly launch KiXtart scripts via LPO/GPO without the use of a batch file.

Two steps need ot be performed on the computer that is going to use the KiXtart script. These tow steps will result in the association of a KiXtart script extension with the KiXtart executable to be used to run the script. There are two options to achieve this, either via command-line or via registry modification.

The following two command-line commands will create this association and specify that files with the . KXS (KiXtart Script) are using the WKIX32.EXE (should be located in a directory listed in %PATH%, e.g. %WINDIR%. Otherwise, provide the full path to WKIX32.EXE) and that all command-line switches are being passed into WKIX32.EXE for further interpretation.
Code:

ASSOC .KXS=KiXtart.Script
FTYPE KiXtart.Script=wkix32.exe %1 %*


The same results are achieved by importing the following .REG file which also creates this association.
Code:
REGEDIT4


[HKEY_LOCAL_MACHINE\SOFTWARE\Classes\.kxs]
@="KiXtart.Script"

[HKEY_LOCAL_MACHINE\SOFTWARE\Classes\KiXtart.Script]

[HKEY_LOCAL_MACHINE\SOFTWARE\Classes\KiXtart.Script\Shell]

[HKEY_LOCAL_MACHINE\SOFTWARE\Classes\KiXtart.Script\Shell\Open\Command]
@="wkix32.exe %1 %*"





One can now copy KiXart scripts into the appropriate group policy subfolders and select these KiXtart scripts in the group policy MMCs.

A drawback of this method is that users can now execute .KXS scripts by just double-clicking on it.


Edited by sealeopard (2003-12-09 03:53 PM)
_________________________
There are two types of vessels, submarines and targets.

Top
#109848 - 2003-12-08 07:42 PM Re: How-TO: Run kiXtart scripts via LPO/GPO
Les Offline
KiX Master
*****

Registered: 2001-06-11
Posts: 12734
Loc: fortfrances.on.ca
Jens,
Nice bit of research. I see the reg merge is to HKLM so assume admin rights required. Does that also hold true for the first method? I don't want to test as I abhor associating the extension.
_________________________
Give a man a fish and he will be back for more. Slap him with a fish and he will go away forever.

Top
#109849 - 2003-12-08 07:57 PM Re: How-TO: Run kiXtart scripts via LPO/GPO
Sealeopard Offline
KiX Master
*****

Registered: 2001-04-25
Posts: 11164
Loc: Boston, MA, USA
Haven't tried it with user-privs. However, the association should be done computer-wide so that all users will be able to run the scripts. I also don't know wheter one could craft a GPO that forces this association as I don't have AD.
_________________________
There are two types of vessels, submarines and targets.

Top
#109850 - 2003-12-09 01:22 AM Re: How-TO: Run kiXtart scripts via LPO/GPO
NTDOC Administrator Offline
Administrator
*****

Registered: 2000-07-28
Posts: 11623
Loc: CA
Quote:

A drawback of this method is that users can now execute .KXS scripts by just double-clicking on it




This is ONE of the main reasons (in my opinion) for using KiXtart. There is no association. Which is how VBS got such a bad rap in the first place when Melissa came along.

I'm content to just use the users LOGON script inside his/her property settings of AD. I don't need a batch file there either.

Finance\WKIX32.EXE Finance\LOGON.KIX

Works just fine for me. But I'm sure there are others out there that will very much appreciate your information Jens and use it.

Top
#109851 - 2003-12-09 04:01 AM Re: How-TO: Run kiXtart scripts via LPO/GPO
Sealeopard Offline
KiX Master
*****

Registered: 2001-04-25
Posts: 11164
Loc: Boston, MA, USA
I totally agree with this assessment. I don't want the .KXS association either. However, I was curious how to trick the GPO into using KiXtart scripts. I'd also go with the logon script property in AD (once we actually go over to AD).
_________________________
There are two types of vessels, submarines and targets.

Top
#109852 - 2003-12-09 06:17 AM Re: How-TO: Run kiXtart scripts via LPO/GPO
Lonkero Administrator Offline
KiX Master Guru
*****

Registered: 2001-06-05
Posts: 22346
Loc: OK
do not understand what is the trick here though.
this is normal filetype registeration.
obviously - on windows - if you want to execute a file that is not executable, you need to have the information specified by which executable it is to be ran.
so, no magic here.
_________________________
!

download KiXnet

Top
#109853 - 2003-12-09 09:50 AM Re: How-TO: Run kiXtart scripts via LPO/GPO
NTDOC Administrator Offline
Administrator
*****

Registered: 2000-07-28
Posts: 11623
Loc: CA
I agree Lonk. No magic and I know how to do this as well. However, not everyone does and Jens was simply posting how to do it so that it makes it very easy for someone to make this change if they so desire and don't already know how.

That is one of the main purposes of this board I think. Sharing thoughts and ideas. Not just serving up code when and only when asked.

Top
#109854 - 2003-12-09 03:52 PM Re: How-TO: Run KiXtart scripts via LPO/GPO
Sealeopard Offline
KiX Master
*****

Registered: 2001-04-25
Posts: 11164
Loc: Boston, MA, USA
Yeah, that's why the subject line says HOW-TO:

A lot of people (incl. sys admins) no longer know how to use the command line, thus they try to assign a KiXtart script via the LPO/GPO MMC and then wonder why it doesn't work. They might then check the documentation and find out that by default only executables and WSH-based script extensions are supported.
_________________________
There are two types of vessels, submarines and targets.

Top
#109855 - 2003-12-09 06:14 PM Re: How-TO: Run KiXtart scripts via LPO/GPO
Sealeopard Offline
KiX Master
*****

Registered: 2001-04-25
Posts: 11164
Loc: Boston, MA, USA
Little add-on to the registry hack to make the script extension also have a desciption:
Code:
REGEDIT4


[HKEY_LOCAL_MACHINE\SOFTWARE\Classes\.kxs]
@="KiXtart.Script"

[HKEY_LOCAL_MACHINE\SOFTWARE\Classes\KiXtart.Script]
@="KiXtart Script"

[HKEY_LOCAL_MACHINE\SOFTWARE\Classes\KiXtart.Script\Shell]

[HKEY_LOCAL_MACHINE\SOFTWARE\Classes\KiXtart.Script\Shell\Open\Command]
@="wkix32.exe %1 %*"



The registry settings could either be packaged into a .MSI file for distribution to all computers via GPO or alternatively, a custom .ADM file cound be created in order to distribute the registry settings on a per-computer basis.

And here's a little freeware program that can make .MSI files: http://www.labyrinth.net.au/~dbareis/makemsi.htm


Edited by sealeopard (2003-12-09 06:16 PM)
_________________________
There are two types of vessels, submarines and targets.

Top
#109856 - 2004-10-20 06:36 PM Re: How-TO: Run kiXtart scripts via LPO/GPO
Mit Offline
Fresh Scripter

Registered: 2002-06-05
Posts: 36
Loc: Derby, UK
Quote:

Quote:

A drawback of this method is that users can now execute .KXS scripts by just double-clicking on it




Finance\WKIX32.EXE Finance\LOGON.KIX

Works just fine for me. But I'm sure there are others out there that will very much appreciate your information Jens and use it.





The problem with this system is that it relies on a modification for all users. Until now we have had a single logon script that everyone ran and did things based on group membership - I'm guessing a lot of people do the same thing.

What I would like to do now that I'm looking at AD is to have a little logon script for each GP object.

I've made a GP OU called 'staff' into which I've created more OUs, one for each company department. The 'staff' OU is the one that contains most of the security settings and so forth, plus a generic logon script that everyone will run which maps their home drive, etc.

However, for each dept I want to run an additional script. I basically need to be able to put a line into the LOGON section of each OU's GP object that will run a KiX script. I can't see how to do this though... and I don't want to have to register the KiX extension.

Anyone....?

Top
#109857 - 2004-10-20 06:48 PM Re: How-TO: Run kiXtart scripts via LPO/GPO
Les Offline
KiX Master
*****

Registered: 2001-06-11
Posts: 12734
Loc: fortfrances.on.ca
You don't need to register the extension if you are willing to use a BATch file to kick it off.
_________________________
Give a man a fish and he will be back for more. Slap him with a fish and he will go away forever.

Top
#109858 - 2004-10-20 06:51 PM Re: How-TO: Run kiXtart scripts via LPO/GPO
Les Offline
KiX Master
*****

Registered: 2001-06-11
Posts: 12734
Loc: fortfrances.on.ca
Also, please start your own topic rather than hijaak this one.
_________________________
Give a man a fish and he will be back for more. Slap him with a fish and he will go away forever.

Top
#109859 - 2004-10-26 12:34 PM Re: How-TO: Run kiXtart scripts via LPO/GPO
Mit Offline
Fresh Scripter

Registered: 2002-06-05
Posts: 36
Loc: Derby, UK
Hijack? Excuse me but I replied to an existing topic that related to a query that I have. I really don't see how that can be seen as a hijack..... Bizarre.

As for the batch file, I don't want to be firing off multiple batch files just in order to start a KiX script. I'd much rather be able to just plonk the KiX script name directly into the GP object.

Top
Page 1 of 1 1


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

Who's Online
1 registered (Allen) and 466 anonymous users online.
Newest Members
gespanntleuchten, DaveatAdvanced, Paulo_Alves, UsTaaa, xxJJxx
17864 Registered Users

Generated in 0.065 seconds in which 0.024 seconds were spent on a total of 13 queries. Zlib compression enabled.

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