Hello All,
I've been having a hard time doing something so simple.....
Here's what my plan is:
I want to use wkix32.exe to run an AutoIt script (wsh) to close any window that has the word hotmail in it every 30 seconds.
My method of distribution is using kix to import a reg file that runs wkix32 and the associated hotmailkiller kix script in the runonce key.
The problem is that whenever I log on wkix32 hangs the machine when logging in. I know wkix32.exe is running because I can see it in Task Manager.
Here's the following code:
hotmail.kix
code:
;Kill Hotmail Windows Every n Seconds
Break ON
Shell "%SYSTEMROOT%\System32\REGSVR32.exe /S @LSERVER\NETLOGON\KIX\AutoItX.dll"
:begin
Shell 'CMD.exe /c wscript.exe @LSERVER\Netlogon\Kix\hotmail.vbs'
Sleep 30
Goto "begin"
hotmail.vbs
code:
''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
' Hotmail Killer
' Author: Brian
''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
' Must register the AutoItX.dll before use
' Require Variants to be declared before used
Option Explicit
'''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
' Declare Variables & Objects
'''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
Dim oShell
Dim oAutoIt
''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
' Initialise Variables & Objects
''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
Set oShell = WScript.CreateObject("WScript.Shell")
Set oAutoIt = WScript.CreateObject("AutoItX.Control")
'''''''''''''''''''''''''''''''''''''''''''''''''''''''
' Start of Script
'''''''''''''''''''''''''''''''''''''''''''''''''''''''
oAutoIt.SetTitleMatchMode 2
dim hotmailExists
'Does a hotmail window exist?
hotmailExists = oAutoIt.IfWinExist("Hotmail","")
'Close hotmail windows until they're all closed
Do While hotmailExists <> "0"
oAutoIt.WinClose "Hotmail",""
hotmailExists = oAutoIt.IfWinExist("Hotmail","")
Loop
WScript.Quit
regfile to be imported.
Windows Registry Editor Version 5.00
[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\RunOnce]
"Update"="\\\\server\\netlogon\\kix\\wkix32.exe \\\\server\\netlogon\\kix\\hotmail.kix"
I'm using Kix 4.01
Any help would be appreciated! ![[Embarrassed]](images/icons/blush.gif)
[ 05 July 2002, 19:25: Message edited by: badboii ]
_________________________
==========================
Brian Zamora
Computer Technician
brian_zamora@hotmail.com
==========================