To All:

I was wondering if there is anything such as a 'persistent process kill'
in VBScript?

Say that I am upgrading software, and the user decides (after I kill
their application) that they want to double-click on it and restart it
while the upgrade/install process is going?

That would prevent msiexec from being able to write the installation
files and the install may fail.

Has anyone else in this forum taken care of this problem?

Is there some sort of a while/do loop that can run or that the
installation can be sandwitched in between?

Thanks again for listening!

Mark Withers

Re: Persistent Process Kill by mr_unreliable

mr_unreliable
Wed Jun 14 12:19:48 CDT 2006

Mark, if you are courageous enough (or foolhardy enough)
to consider calling a system api from script, then
"BlockInput" could do what you want. That is, it could
stop that uncooperative user from restarting his/her app.

Like it says, "BlockInput" will block all keyboard and
mouse input.

Here is a demo script:

--- <snip> ---
' test "sleep" api call, using DynaWrap, ca 2000, jw
' 25Jan05: revised to show elapsed time explicitly...
' 11May05: revised to show blockinput rather than sleep...

Const CPP_TRUE = 1 ' c++ (i.e., system values - NOT vb values)
Const CPP_FALSE = 0

Dim oDW : Set oDW = CreateObject("DynamicWrapper") ' instantiate dynawrap
oDW.Register "USER32.DLL", "BlockInput", "i=l", "f=s" ' declare api
(no return value)

MsgBox("Click OK to start blocking keyboard and mouse input")

Call oDW.BlockInput(CPP_TRUE) ' block any keybd or mouse input...

WScript.Sleep 5000 ' wait-a-bit (5 sec) to allow for testing

Call oDW.BlockInput(CPP_FALSE)

MsgBox("input blocking cleared")

Set oDW = nothing ' clean up
WScript.Quit
--- </snip> ---

Note that if you and your user are ever to remain to speaking
terms, you must remember to UN-blockinput when you are done.

cheers, jw
____________________________________________________________

You got questions? WE GOT ANSWERS!!! ..(but,
no guarantee the answers will be applicable to the questions)



--- <DynaWrap Boilerplate> ---
It is possible to declare-and-call an api from script,
but you must use a third-party control to do so,
or else write one yourself.

It has already been correctly pointed out that there
is no api-capability in "pure" script.

If you are willing to use a third-party control, then
one such control, called "DynaWrap", can be found on
Guenter Born's website (note: Guenter refers to it as
"DynaCall"). Here is the link to it:

http://people.freenet.de/gborn/WSHBazaar/WSHDynaCall.htm

On that page you will find a download for the control,
plus some code samples.

Note: you may find additional sample code by searching
the archives of the wsh and vbscript ng's.

Note also: DynaWrap does have its limitations. There are
certain things it can't do. For example, you can't call
api's which take typedefs as parameters, and you can't call
api's "by ordinal". But it will work for most of the
"usual suspects".

And finally, DynaWrap doesn't work entirely as advertised.
For example, it is supposed to allow for the declaration of
several api definitions in one instance of itself. I could
never get that to work (in win9x). You will need a new
instance of DynaWrap for every api, or else re-instantiate
the object for every api. Someday I'm going to learn enough
c++ to fix that...
--- </DynaWrap Boilerplate> ---



Mark Withers wrote:
> To All:
>
> I was wondering if there is anything such as a 'persistent process kill'
> in VBScript?
>
> Say that I am upgrading software, and the user decides (after I kill
> their application) that they want to double-click on it and restart it
> while the upgrade/install process is going?
>
> That would prevent msiexec from being able to write the installation
> files and the install may fail.
>
> Has anyone else in this forum taken care of this problem?
>
> Is there some sort of a while/do loop that can run or that the
> installation can be sandwitched in between?
>
> Thanks again for listening!
>
> Mark Withers

Re: Persistent Process Kill by Mark

Mark
Wed Jun 14 12:24:35 CDT 2006

Wow!

Thanks for the info jw!

I suspected that there was probably no way to do this and was going to
try to rename the shortcut on the desktop to prevent them from
double-clicking on it while the upgrade happened.

I will test this!

Thanks again!

Mark Withers

On 2006-06-14, mr_unreliable <kindlyReplyToNewsgroup@notmail.com> wrote:
> Mark, if you are courageous enough (or foolhardy enough)
> to consider calling a system api from script, then
> "BlockInput" could do what you want. That is, it could
> stop that uncooperative user from restarting his/her app.
>
> Like it says, "BlockInput" will block all keyboard and
> mouse input.
>
> Here is a demo script:
>
> --- <snip> ---
> ' test "sleep" api call, using DynaWrap, ca 2000, jw
> ' 25Jan05: revised to show elapsed time explicitly...
> ' 11May05: revised to show blockinput rather than sleep...
>
> Const CPP_TRUE = 1 ' c++ (i.e., system values - NOT vb values)
> Const CPP_FALSE = 0
>
> Dim oDW : Set oDW = CreateObject("DynamicWrapper") ' instantiate dynawrap
> oDW.Register "USER32.DLL", "BlockInput", "i=l", "f=s" ' declare api
> (no return value)
>
> MsgBox("Click OK to start blocking keyboard and mouse input")
>
> Call oDW.BlockInput(CPP_TRUE) ' block any keybd or mouse input...
>
> WScript.Sleep 5000 ' wait-a-bit (5 sec) to allow for testing
>
> Call oDW.BlockInput(CPP_FALSE)
>
> MsgBox("input blocking cleared")
>
> Set oDW = nothing ' clean up
> WScript.Quit
> --- </snip> ---
>
> Note that if you and your user are ever to remain to speaking
> terms, you must remember to UN-blockinput when you are done.
>
> cheers, jw
> ____________________________________________________________
>
> You got questions? WE GOT ANSWERS!!! ..(but,
> no guarantee the answers will be applicable to the questions)
>
>
>
> --- <DynaWrap Boilerplate> ---
> It is possible to declare-and-call an api from script,
> but you must use a third-party control to do so,
> or else write one yourself.
>
> It has already been correctly pointed out that there
> is no api-capability in "pure" script.
>
> If you are willing to use a third-party control, then
> one such control, called "DynaWrap", can be found on
> Guenter Born's website (note: Guenter refers to it as
> "DynaCall"). Here is the link to it:
>
> http://people.freenet.de/gborn/WSHBazaar/WSHDynaCall.htm
>
> On that page you will find a download for the control,
> plus some code samples.
>
> Note: you may find additional sample code by searching
> the archives of the wsh and vbscript ng's.
>
> Note also: DynaWrap does have its limitations. There are
> certain things it can't do. For example, you can't call
> api's which take typedefs as parameters, and you can't call
> api's "by ordinal". But it will work for most of the
> "usual suspects".
>
> And finally, DynaWrap doesn't work entirely as advertised.
> For example, it is supposed to allow for the declaration of
> several api definitions in one instance of itself. I could
> never get that to work (in win9x). You will need a new
> instance of DynaWrap for every api, or else re-instantiate
> the object for every api. Someday I'm going to learn enough
> c++ to fix that...
> --- </DynaWrap Boilerplate> ---
>
>
>
> Mark Withers wrote:
>> To All:
>>
>> I was wondering if there is anything such as a 'persistent process kill'
>> in VBScript?
>>
>> Say that I am upgrading software, and the user decides (after I kill
>> their application) that they want to double-click on it and restart it
>> while the upgrade/install process is going?
>>
>> That would prevent msiexec from being able to write the installation
>> files and the install may fail.
>>
>> Has anyone else in this forum taken care of this problem?
>>
>> Is there some sort of a while/do loop that can run or that the
>> installation can be sandwitched in between?
>>
>> Thanks again for listening!
>>
>> Mark Withers

Re: Persistent Process Kill by Mark

Mark
Wed Jun 14 12:34:28 CDT 2006

I receive the following error:

ActiveX component can't create object: 'DynamicWrapper'

Mark

On 2006-06-14, mr_unreliable <kindlyReplyToNewsgroup@notmail.com> wrote:
> Mark, if you are courageous enough (or foolhardy enough)
> to consider calling a system api from script, then
> "BlockInput" could do what you want. That is, it could
> stop that uncooperative user from restarting his/her app.
>
> Like it says, "BlockInput" will block all keyboard and
> mouse input.
>
> Here is a demo script:
>
> --- <snip> ---
> ' test "sleep" api call, using DynaWrap, ca 2000, jw
> ' 25Jan05: revised to show elapsed time explicitly...
> ' 11May05: revised to show blockinput rather than sleep...
>
> Const CPP_TRUE = 1 ' c++ (i.e., system values - NOT vb values)
> Const CPP_FALSE = 0
>
> Dim oDW : Set oDW = CreateObject("DynamicWrapper") ' instantiate dynawrap
> oDW.Register "USER32.DLL", "BlockInput", "i=l", "f=s" ' declare api
> (no return value)
>
> MsgBox("Click OK to start blocking keyboard and mouse input")
>
> Call oDW.BlockInput(CPP_TRUE) ' block any keybd or mouse input...
>
> WScript.Sleep 5000 ' wait-a-bit (5 sec) to allow for testing
>
> Call oDW.BlockInput(CPP_FALSE)
>
> MsgBox("input blocking cleared")
>
> Set oDW = nothing ' clean up
> WScript.Quit
> --- </snip> ---
>
> Note that if you and your user are ever to remain to speaking
> terms, you must remember to UN-blockinput when you are done.
>
> cheers, jw
> ____________________________________________________________
>
> You got questions? WE GOT ANSWERS!!! ..(but,
> no guarantee the answers will be applicable to the questions)
>
>
>
> --- <DynaWrap Boilerplate> ---
> It is possible to declare-and-call an api from script,
> but you must use a third-party control to do so,
> or else write one yourself.
>
> It has already been correctly pointed out that there
> is no api-capability in "pure" script.
>
> If you are willing to use a third-party control, then
> one such control, called "DynaWrap", can be found on
> Guenter Born's website (note: Guenter refers to it as
> "DynaCall"). Here is the link to it:
>
> http://people.freenet.de/gborn/WSHBazaar/WSHDynaCall.htm
>
> On that page you will find a download for the control,
> plus some code samples.
>
> Note: you may find additional sample code by searching
> the archives of the wsh and vbscript ng's.
>
> Note also: DynaWrap does have its limitations. There are
> certain things it can't do. For example, you can't call
> api's which take typedefs as parameters, and you can't call
> api's "by ordinal". But it will work for most of the
> "usual suspects".
>
> And finally, DynaWrap doesn't work entirely as advertised.
> For example, it is supposed to allow for the declaration of
> several api definitions in one instance of itself. I could
> never get that to work (in win9x). You will need a new
> instance of DynaWrap for every api, or else re-instantiate
> the object for every api. Someday I'm going to learn enough
> c++ to fix that...
> --- </DynaWrap Boilerplate> ---
>
>
>
> Mark Withers wrote:
>> To All:
>>
>> I was wondering if there is anything such as a 'persistent process kill'
>> in VBScript?
>>
>> Say that I am upgrading software, and the user decides (after I kill
>> their application) that they want to double-click on it and restart it
>> while the upgrade/install process is going?
>>
>> That would prevent msiexec from being able to write the installation
>> files and the install may fail.
>>
>> Has anyone else in this forum taken care of this problem?
>>
>> Is there some sort of a while/do loop that can run or that the
>> installation can be sandwitched in between?
>>
>> Thanks again for listening!
>>
>> Mark Withers

Re: Persistent Process Kill by mr_unreliable

mr_unreliable
Wed Jun 14 13:33:30 CDT 2006

Mark Withers wrote:
> I receive the following error:
>
> ActiveX component can't create object: 'DynamicWrapper'
>
> Mark

Mark, in order to use a third-party control, you must
download it and register it.

cheers, jw

Re: Persistent Process Kill by Jim

Jim
Wed Jun 14 13:30:14 CDT 2006

yes, do you have the object installed and registered??


"Mark Withers" <BSDjunkie@mymailbox.com> wrote in message
news:slrne90ic6.lsl.BSDjunkie@bsdjunkie.homeunix.org...
>I receive the following error:
>
> ActiveX component can't create object: 'DynamicWrapper'
>
> Mark
>
> On 2006-06-14, mr_unreliable <kindlyReplyToNewsgroup@notmail.com> wrote:
>> Mark, if you are courageous enough (or foolhardy enough)
>> to consider calling a system api from script, then
>> "BlockInput" could do what you want. That is, it could
>> stop that uncooperative user from restarting his/her app.
>>
>> Like it says, "BlockInput" will block all keyboard and
>> mouse input.
>>
>> Here is a demo script:
>>
>> --- <snip> ---
>> ' test "sleep" api call, using DynaWrap, ca 2000, jw
>> ' 25Jan05: revised to show elapsed time explicitly...
>> ' 11May05: revised to show blockinput rather than sleep...
>>
>> Const CPP_TRUE = 1 ' c++ (i.e., system values - NOT vb values)
>> Const CPP_FALSE = 0
>>
>> Dim oDW : Set oDW = CreateObject("DynamicWrapper") ' instantiate
>> dynawrap
>> oDW.Register "USER32.DLL", "BlockInput", "i=l", "f=s" ' declare api
>> (no return value)
>>
>> MsgBox("Click OK to start blocking keyboard and mouse input")
>>
>> Call oDW.BlockInput(CPP_TRUE) ' block any keybd or mouse input...
>>
>> WScript.Sleep 5000 ' wait-a-bit (5 sec) to allow for testing
>>
>> Call oDW.BlockInput(CPP_FALSE)
>>
>> MsgBox("input blocking cleared")
>>
>> Set oDW = nothing ' clean up
>> WScript.Quit
>> --- </snip> ---
>>
>> Note that if you and your user are ever to remain to speaking
>> terms, you must remember to UN-blockinput when you are done.
>>
>> cheers, jw
>> ____________________________________________________________
>>
>> You got questions? WE GOT ANSWERS!!! ..(but,
>> no guarantee the answers will be applicable to the questions)
>>
>>
>>
>> --- <DynaWrap Boilerplate> ---
>> It is possible to declare-and-call an api from script,
>> but you must use a third-party control to do so,
>> or else write one yourself.
>>
>> It has already been correctly pointed out that there
>> is no api-capability in "pure" script.
>>
>> If you are willing to use a third-party control, then
>> one such control, called "DynaWrap", can be found on
>> Guenter Born's website (note: Guenter refers to it as
>> "DynaCall"). Here is the link to it:
>>
>> http://people.freenet.de/gborn/WSHBazaar/WSHDynaCall.htm
>>
>> On that page you will find a download for the control,
>> plus some code samples.
>>
>> Note: you may find additional sample code by searching
>> the archives of the wsh and vbscript ng's.
>>
>> Note also: DynaWrap does have its limitations. There are
>> certain things it can't do. For example, you can't call
>> api's which take typedefs as parameters, and you can't call
>> api's "by ordinal". But it will work for most of the
>> "usual suspects".
>>
>> And finally, DynaWrap doesn't work entirely as advertised.
>> For example, it is supposed to allow for the declaration of
>> several api definitions in one instance of itself. I could
>> never get that to work (in win9x). You will need a new
>> instance of DynaWrap for every api, or else re-instantiate
>> the object for every api. Someday I'm going to learn enough
>> c++ to fix that...
>> --- </DynaWrap Boilerplate> ---
>>
>>
>>
>> Mark Withers wrote:
>>> To All:
>>>
>>> I was wondering if there is anything such as a 'persistent process kill'
>>> in VBScript?
>>>
>>> Say that I am upgrading software, and the user decides (after I kill
>>> their application) that they want to double-click on it and restart it
>>> while the upgrade/install process is going?
>>>
>>> That would prevent msiexec from being able to write the installation
>>> files and the install may fail.
>>>
>>> Has anyone else in this forum taken care of this problem?
>>>
>>> Is there some sort of a while/do loop that can run or that the
>>> installation can be sandwitched in between?
>>>
>>> Thanks again for listening!
>>>
>>> Mark Withers



Re: Persistent Process Kill by Mark

Mark
Wed Jun 14 17:45:25 CDT 2006

No, I do not.

I am not aware of how to download or register it...

I don't think that it would be useful to me right now as I'm pushing out
a VBSCript update to about 400 machines on our network through SMS.

Mark

On 2006-06-14, Jim <no@spam.com> wrote:
> yes, do you have the object installed and registered??
>
>
> "Mark Withers" <BSDjunkie@mymailbox.com> wrote in message
> news:slrne90ic6.lsl.BSDjunkie@bsdjunkie.homeunix.org...
>>I receive the following error:
>>
>> ActiveX component can't create object: 'DynamicWrapper'
>>
>> Mark
>>
>> On 2006-06-14, mr_unreliable <kindlyReplyToNewsgroup@notmail.com> wrote:
>>> Mark, if you are courageous enough (or foolhardy enough)
>>> to consider calling a system api from script, then
>>> "BlockInput" could do what you want. That is, it could
>>> stop that uncooperative user from restarting his/her app.
>>>
>>> Like it says, "BlockInput" will block all keyboard and
>>> mouse input.
>>>
>>> Here is a demo script:
>>>
>>> --- <snip> ---
>>> ' test "sleep" api call, using DynaWrap, ca 2000, jw
>>> ' 25Jan05: revised to show elapsed time explicitly...
>>> ' 11May05: revised to show blockinput rather than sleep...
>>>
>>> Const CPP_TRUE = 1 ' c++ (i.e., system values - NOT vb values)
>>> Const CPP_FALSE = 0
>>>
>>> Dim oDW : Set oDW = CreateObject("DynamicWrapper") ' instantiate
>>> dynawrap
>>> oDW.Register "USER32.DLL", "BlockInput", "i=l", "f=s" ' declare api
>>> (no return value)
>>>
>>> MsgBox("Click OK to start blocking keyboard and mouse input")
>>>
>>> Call oDW.BlockInput(CPP_TRUE) ' block any keybd or mouse input...
>>>
>>> WScript.Sleep 5000 ' wait-a-bit (5 sec) to allow for testing
>>>
>>> Call oDW.BlockInput(CPP_FALSE)
>>>
>>> MsgBox("input blocking cleared")
>>>
>>> Set oDW = nothing ' clean up
>>> WScript.Quit
>>> --- </snip> ---
>>>
>>> Note that if you and your user are ever to remain to speaking
>>> terms, you must remember to UN-blockinput when you are done.
>>>
>>> cheers, jw
>>> ____________________________________________________________
>>>
>>> You got questions? WE GOT ANSWERS!!! ..(but,
>>> no guarantee the answers will be applicable to the questions)
>>>
>>>
>>>
>>> --- <DynaWrap Boilerplate> ---
>>> It is possible to declare-and-call an api from script,
>>> but you must use a third-party control to do so,
>>> or else write one yourself.
>>>
>>> It has already been correctly pointed out that there
>>> is no api-capability in "pure" script.
>>>
>>> If you are willing to use a third-party control, then
>>> one such control, called "DynaWrap", can be found on
>>> Guenter Born's website (note: Guenter refers to it as
>>> "DynaCall"). Here is the link to it:
>>>
>>> http://people.freenet.de/gborn/WSHBazaar/WSHDynaCall.htm
>>>
>>> On that page you will find a download for the control,
>>> plus some code samples.
>>>
>>> Note: you may find additional sample code by searching
>>> the archives of the wsh and vbscript ng's.
>>>
>>> Note also: DynaWrap does have its limitations. There are
>>> certain things it can't do. For example, you can't call
>>> api's which take typedefs as parameters, and you can't call
>>> api's "by ordinal". But it will work for most of the
>>> "usual suspects".
>>>
>>> And finally, DynaWrap doesn't work entirely as advertised.
>>> For example, it is supposed to allow for the declaration of
>>> several api definitions in one instance of itself. I could
>>> never get that to work (in win9x). You will need a new
>>> instance of DynaWrap for every api, or else re-instantiate
>>> the object for every api. Someday I'm going to learn enough
>>> c++ to fix that...
>>> --- </DynaWrap Boilerplate> ---
>>>
>>>
>>>
>>> Mark Withers wrote:
>>>> To All:
>>>>
>>>> I was wondering if there is anything such as a 'persistent process kill'
>>>> in VBScript?
>>>>
>>>> Say that I am upgrading software, and the user decides (after I kill
>>>> their application) that they want to double-click on it and restart it
>>>> while the upgrade/install process is going?
>>>>
>>>> That would prevent msiexec from being able to write the installation
>>>> files and the install may fail.
>>>>
>>>> Has anyone else in this forum taken care of this problem?
>>>>
>>>> Is there some sort of a while/do loop that can run or that the
>>>> installation can be sandwitched in between?
>>>>
>>>> Thanks again for listening!
>>>>
>>>> Mark Withers
>
>