views:

3003

answers:

5

EDIT: This was formerly more explicitly titled: - "Best solution to stop Kontiki's KHOST.EXE from loading automatically at start-up on Windows XP?"

Essentially, whenever the 40D application is run it sets up khost.exe to automatically start-up with Windows. This is annoying as it increases my boot up time by a couple of minutes and I don't even use the P2P aspect of 4OD anyway.

The registry keys that are set are:

Command: C:\Program Files\Kontiki\KHost.exe -all
Description: kdx
Location: HKU\S-1-5-21-1757981266-1960408961-839522115-1003\SOFTWARE\Microsoft\Windows\CurrentVersion\Run
Name: kdx
Setting ID:
User: LAPTOP\Me

Command: "C:\Program Files\Kontiki\KHost.exe" -all
Description: 4oD
Location: HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Run
Name: 4oD
Setting ID:
User: All Users

I'm assuming some kind of start-up or shut-down script to delete these registry keys would be the best solution, but I'm not that up with .vbs or .bat scripting or where I'd put them to automatically run at an appropriate time.

I know there is a TV On-Demand Monitor application, but I don't really need to be running yet another process, I just need to delete the registry keys as I describe above.

A: 

Why not just copy the executable to some other name, and put a do-nothing exe in its place. Then change your shortcuts to the copied and renamed EXE. If the program is sensitive to its name, then point your shortcuts to a VBS file to temporarily rename the EXE file.

Frank Krueger
+1  A: 

for the vb script you would use something like this:

Dim WSHShell
Set WSHShell = WScript.CreateObject("WScript.Shell")
'repeat the line below for each key to delete 
WSHShell.RegDelete "[Location of Key]"

Just drop the code into a text file and re-name it something like shutdown,vbs.

As for when to run it, if you are in a corporate environment you could use a group policy and set it as a machine shutdown script. Alternatively, see this page here about adding it manually

beakersoft
A: 

Another method:

Create a VBS file that runs the program and then deletes the registry keys.

Set objShell = CreateObject("WScript.Shell") 

objShell.Exec("C:\Program Files\Kontiki\KHost.exe")

strRoot = "HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Run\4oD" 
strDelete = objShell.RegDelete(strRoot) 
...

And point your shortcuts at that.

Frank Krueger
A: 

Should I suggest you give a try to AutoIt (http://www.autoitscript.com/autoit3/), a freeware scripting language designed for automating the Windows GUI and general scripting.

If you choose to use it, the AutoIt code for your need would be a 2-liner:

RegDelete("YourKey", "YourValue");
ShutDown(1);

And you can compile it into a standalone exe that can run on any computer (no runtime library needed)

Pascal T.
+1  A: 

What I ended up doing in the end:

1) Stopped 40D from the task tray with a right-click > exit which terminated the Khost.exe process.

2) Opened Start > All Programs > Administrative Tools > Services and stopped KService then set the Startup Type to 'Manual'.

3) Created a ShutdownScript.vbs with the following content:

Set SH = CreateObject("WScript.Shell")

RemoveRegKey "HKU\S-1-5-21-1757981266-1960408961-839522115-1003\SOFTWARE\Microsoft\Windows\CurrentVersion\Run\kdx"
RemoveRegKey "HKEY_CURRENT_USER\SOFTWARE\Microsoft\Windows\CurrentVersion\Run\kdx"
RemoveRegKey "HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Run\4oD"

Shutdown

Set Shell = Nothing
Set SH = Nothing
WScript.Quit

Sub RemoveRegKey(sKey)
    On Error Resume Next
    SH.RegDelete sKey
End Sub

Sub Shutdown()
    SH.Run "shutdown -s -t 1", 0, TRUE
End Sub

4) Put a shortcut to the script in my Start Menu and now use that to shut the PC down.

Now 40D will work when I need it, and all I have to do is quit it and shutdown with the script to stop it auto-starting everytime I boot up the PC.

THANKS FOR ALL YOUR HELP WITH THIS! :)

Matt