Re: Macro to kill a process



Dim objProcess As System.Diagnostics.Process

For Each objProcess in
System.Diagnostics.Process.GetProcessesByName("notepad.exe")
objProcess.Kill
Next

--

Best regards,

Carlos J. Quintero

MZ-Tools: Productivity add-ins for Visual Studio 2005, Visual Studio .NET,
VB6, VB5 and VBA
You can code, design and document much faster in VB.NET, C#, C++ or VJ#
Free resources for add-in developers:
http://www.mztools.com


"Lynn" <MarryLynn@xxxxxxxxx> escribió en el mensaje
news:OYrWoVeFGHA.1676@xxxxxxxxxxxxxxxxxxxxxxx
> Hi,
> can i know how does the code looks like?
> thanks
>
> "Carlos J. Quintero [VB MVP]" <carlosq@xxxxxxxxxxxxxxxxxxx> wrote in
> message
> news:OkuKeqcFGHA.2708@xxxxxxxxxxxxxxxxxxxxxxx
>> Hi,
>>
>> You can use the System.Diagnostics.Process.GetProcessXXX() static methods
>> and once you have the Process you use the Kill method.
>>
>> --
>>
>> Best regards,
>>
>> Carlos J. Quintero
>>
>> MZ-Tools: Productivity add-ins for Visual Studio 2005, Visual Studio
>> .NET,
>> VB6, VB5 and VBA
>> You can code, design and document much faster in VB.NET, C#, C++ or VJ#
>> Free resources for add-in developers:
>> http://www.mztools.com
>>
>>
>> "Oenone" <oenone@xxxxxxxxxxx> escribió en el mensaje
>> news:%23ACm1NTFGHA.3100@xxxxxxxxxxxxxxxxxxxxxxx
>> > Hopefully this is the right place to post this -- if not, please let me
>> > know where the appropriate place is.
>> >
>> > Can anyone point me to a VS2005 macro that locates a running Windows
>> > process by name and then kills it?
>> >
>> > Many thanks,
>> >
>> > --
>> >
>> > (O)enone
>> >
>>
>>
>
>


.



Relevant Pages

  • Re: VC++ 2005 Express - Tools -> Command Prompt
    ... Carlos J. Quintero ... MZ-Tools: Productivity add-ins for Visual Studio ...
    (microsoft.public.vsnet.ide)
  • Re: VS.NET 2005
    ... Carlos J. Quintero ... Productivity add-ins for Visual Studio 2005, Visual Studio .NET, ... > forever to seach, is there any setting to disable this if I am correct ...
    (microsoft.public.vsnet.general)
  • Re: Run macro at startup
    ... Productivity add-ins for Visual Studio ... >> Carlos J. Quintero ... design and document much faster: ...
    (microsoft.public.vsnet.general)
  • Re: Owner Drawing ListView in .NET 2.0
    ... Best regards, ... Carlos J. Quintero ... Productivity add-ins for Visual Studio 2005, Visual Studio .NET, ...
    (microsoft.public.dotnet.languages.vb)
  • Re: how to show line numbers
    ... Carlos J. Quintero ... MZ-Tools 4.0: Productivity add-ins for Visual Studio .NET ...
    (microsoft.public.vsnet.ide)

Loading