Page 1 of 1 1
Topic Options
#12101 - 2001-09-04 08:23 PM Executing a Kix Script on bootup
Anonymous
Unregistered


Sorry if this has been asked before. Does anyone know how to make a Kix script auto execute as a service on bootup of a W2k Server.

Thanks in advance!!

Top
#12102 - 2001-10-22 04:11 AM Re: Executing a Kix Script on bootup
MCA Offline
KiX Supporter
*****

Registered: 2000-04-28
Posts: 5152
Loc: Netherlands, EU
Dear,

We are running kixtart script by a registry key. First we check for the script.
No script means no registry entry will be created.
Also we transform kix32.exe to the exact locaton in your windows
directory.
After each reboot the script will be run automatically, which make it
possible to run such script also on windows NT/W2K easily.

Our script part is

code:

$prgrm_name="c:\kixtart\your_script.kix" ; - value used for registry entry -


$ikey="HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion\Run"
$default_key="kix-local"
$default_value="kix32.exe "+$prgrm_name
IF (Exist("c:\windows\kix32.exe") = 1)
$default_value="c:\windows\kix32.exe "+$prgrm_name
ENDIF
IF (Exist("c:\winnt\kix32.exe") = 1)
$default_value="c:\winnt\kix32.exe "+$prgrm_name
ENDIF
IF (Exist($prgrm_name) = 1)
IF (ExistKey($ikey) = 0)
IF (ReadValue($ikey, $default_key) <> $default_value)
IF (WriteValue($ikey, $default_key, $default_value, "REG_SZ") = 0)
ENDIF
$info=$info+" "+$default_key+"='"+$default_value+"'"
ENDIF
ENDIF
ENDIF



Explanation:
  • $prgrm_name = path of your script.
  • $default_key = name of the RUN key in your registry.
  • $default_value = command which should be run by a reboot.
Greetings.


btw: we didn't run it as service. it only gives you an idea "how to run
a script during a reboot".

[ 22 October 2001: Message edited by: MCA ]

_________________________
email scripting@wanadoo.nl homepage scripting@wanadoo.nl | Links | Summary of Site Site KiXforms FAQ kixtart.org library collection mirror MCA | FAQ & UDF help file UDF kixtart.org library collection mirror MCA | mirror USA | mirror europe UDF scriptlogic library collection UDFs | mirror MCA

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 1471 anonymous users online.
Newest Members
Viginette, ManuvdWielNL, Sir_Barrington, batdk82, StuTheCoder
17888 Registered Users

Generated in 0.069 seconds in which 0.045 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