Re-4: using an ActiveX (twiz32.ocx) from runrev by vbs

2008-09-26 Thread [EMAIL PROTECTED]

Hi Ken


BTW, I'm assuming you're talking about Rev 3, right? If not, let me know as
there's a couple of differences between VBS in Rev 2.x and Rev 3.


Thank you all for help - I use 2.9 and did not know that there are differences 
in handling of vbs in the new runrev 3.0.

I came to the following solution: instead of running vbs from runrev I use 
scan.hta (hyptertext application) with the code:

!DOCTYPE HTML PUBLIC -//IETF//DTD HTML//EN
html
head
titleScannen/title
BODY onLoad=scanner.CurrentSource='2';scanner.ShowUI 
='False';scanner.Units='2';scanner.Resolution = 
'150';scanner.ImageLeft='0';scanner.ImageRight='4';scanner.ImageBottom='4';scanner.AcquireToFile('test.jpg');
object ID=scanner
CLASSID=CLSID:A96AC4E0-6EBF-11D0-AA7C-00608CC9A71F
/object
/body
/html


this works from commandline (I use the shell(scan.hta) command from runrev). 
If I would put a Self.Close on the End of the Body onLoad, the scan would not 
start because the hta is closing before. 

A new problem occured:
The mshta.exe process in any case does not close on the machine I am testing on 
(xp sp3). = I do need vbs from runrev for that.

In the case the mshta.exe does not close (a problem in ms windows documented in 
the ms kb) I use the following vbs in field 1 and run it from runrev. This 
works and closes any process mshta.exe.

on mouseUp
put field 1 into auftrag; do auftrag as VBScript; put the result 
end mouseUp


set wmi = GetObject(winmgmts:)
wql = select * from win32_process
set ergebnis = wmi.ExecQuery(wql)
for each objekt in ergebnis
liste = liste  objekt.name   Prozess-ID:   objekt.processID  vbCr
next

wql = select * from win32_process where name='mshta.exe'
set ergebnis = wmi.ExecQuery(wql)
for each mshta in ergebnis
mshta.Terminate 0
next
___
use-revolution mailing list
use-revolution@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-revolution


Re: Re-4: using an ActiveX (twiz32.ocx) from runrev by vbs

2008-09-26 Thread Ken Ray

 In the case the mshta.exe does not close (a problem in ms windows documented
 in the ms kb) I use the following vbs in field 1 and run it from runrev. This
 works and closes any process mshta.exe.
 
 on mouseUp
 put field 1 into auftrag; do auftrag as VBScript; put the result
 end mouseUp
 
 
 set wmi = GetObject(winmgmts:)
 wql = select * from win32_process
 set ergebnis = wmi.ExecQuery(wql)
 for each objekt in ergebnis
 liste = liste  objekt.name   Prozess-ID:   objekt.processID  vbCr
 next
 
 wql = select * from win32_process where name='mshta.exe'
 set ergebnis = wmi.ExecQuery(wql)
 for each mshta in ergebnis
 mshta.Terminate 0
 next

Yes, I do something similar in a more generic kill process handler of mine
(watch word wraps):

on stsKillProcess pProcNameOrID
   put the VBS_KillProcess of this stack into tScript
if isNumber(pProcNameOrID) then
  replace PROCATTRIB with Process.ProcessID in tScript
  replace PROCVALUE with pProcNameOrID in tScript
else
  replace PROCATTRIB with Process.Caption in tScript
  replace PROCVALUE with (quote  toLower(pProcNameOrID)  quote)
in tScript
end if
put stsDoScript(tScript,VBS)   into tResult
-- I have a wrapper around do script that does
-- some add'l error checking, etc.)
if tResult is not empty then answer tResult
end stsKillProcess


--- This is the VBS_KillProcess custom property contents:

Set ProcessSet = 
GetObject(winmgmts:{impersonationLevel=impersonate}).ExecQuery(select *
from Win32_Process)

tResult = 
For each Process in ProcessSet
If Process.ExecutablePath   Then
If LCase(PROCATTRIB)=PROCVALUE Then
Process.Terminate (Process.ProcessID)
Else
tResult=STSError: Process not found.
End If
End If
Next
WScript.Echo tResult
--

Never thought of using HTAs though...

:-)

Ken Ray
Sons of Thunder Software, Inc.
Email: [EMAIL PROTECTED]
Web Site: http://www.sonsothunder.com/


___
use-revolution mailing list
use-revolution@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-revolution