1.    03 Jul 2008 #1
    Mark Guest

    restart a process in XP ..


    Hi there,

    I'm not a programmer and would really appricate some help here. I need a
    VB script to get the PID of a running process from the name and then
    kill it and/or restart it. I read about taskkill, but that opens a DOS
    box and requires the name of the process, the PID of which changes.

    Don't ask me to study examples as when I learned BASIC we were still
    using single letter variable names ..

    $winkill "someProcess" .. kill it ...

    $winkill -r "someProcess" .. kill it and restart ...
      My System SpecsSystem Spec

  2.    03 Jul 2008 #2
    Pegasus \(MVP\) Guest

    Re: restart a process in XP ..



    "Mark" <markbilk@xxxxxx> wrote in message
    news:g4iqju$42p$1@xxxxxx

    > Hi there,
    >
    > I'm not a programmer and would really appricate some help here. I need a
    > VB script to get the PID of a running process from the name and then kill
    > it and/or restart it. I read about taskkill, but that opens a DOS box and
    > requires the name of the process, the PID of which changes.
    >
    > Don't ask me to study examples as when I learned BASIC we were still using
    > single letter variable names ..
    >
    > $winkill "someProcess" .. kill it ...
    >
    > $winkill -r "someProcess" .. kill it and restart ...
    This is my lazy day so I'll give you a one-line batch file solution that
    would
    kill the task "Duc20".

    @echo off
    for /f "tokens=2" %%a in ('tasklist ^| find /i "duc20"') do taskkill /pid
    %%a


      My System SpecsSystem Spec

  3.    03 Jul 2008 #3
    Mark Guest

    Re: restart a process in XP ..


    > This is my lazy day so I'll give you a one-line batch file solution that would kill the task "Duc20".

    > @echo off
    > for /f "tokens=2" %%a in ('tasklist ^| find /i "duc20"') do taskkill /pid %%a
    kool ..

    I've been reading up and I see some other references to PID, I'll try
    the cut and paste method ..
      My System SpecsSystem Spec

  4.    03 Jul 2008 #4
    Pegasus \(MVP\) Guest

    Re: restart a process in XP ..



    "Mark" <markbilk@xxxxxx> wrote in message
    news:g4iskm$75f$1@xxxxxx

    >> This is my lazy day so I'll give you a one-line batch file solution that
    >> would kill the task "Duc20".
    >

    >> @echo off
    >> for /f "tokens=2" %%a in ('tasklist ^| find /i "duc20"') do taskkill /pid
    >> %%a
    >
    > kool ..
    >
    > I've been reading up and I see some other references to PID, I'll try the
    > cut and paste method ..
    You could, of course, kill the task by its name, then restart it:
    @echo off
    tasklist | find /i "duc20" && taskkill /im "duc20.exe" /f
    "c:\Program Files\Duc\Duc20.exe"

    The above code assumes that you're running Windows XP Professional.


      My System SpecsSystem Spec


Similar Threads
Thread Forum
How do you restart a process?
I have a big question I can't seem to get answered anywere else. I accidentally killed process SPI (Creative X-FI Module) And the sound dosen't work...
General Discussion
Failover Guest Cluster -- 'The process cannot access the file becauseit is being used by another process.'
Hello, I have setup a failover cluster using Hyper-V vms. Both guests are Windows Server 2003 Enterprise 64-bit systems with SP2. The host is...
Virtual Server
Process count wrong when only one process matches criteria
Trying to use get-process to determine when one job is finished to start another one $abc | % {...
PowerShell
Is a restart a clean restart
I have noticed recently that when I restart my PC running Vista, on entering windows again, the same file explorer windows that I had open before...
Vista General
IEUser restart through Restart Manager works but...
Hi all, I register an elevation policy and restart IEUser for it to take effect. If this is done from an administrator account, all works fine:...
Vista General
get-process & stop-process by owner
I'm trying to figure out how I can list and stop only those processes that are being run by a specific user like you can with tasklist and taskkill....
PowerShell
Bug? Shouldn't Stop-Process automatically match Id if object is a process?
Although you can pipe a process into Stop-Process, or specify it as an InputObject value, if you supply the process as a default value, it fails...
PowerShell

Our Sites
  • Ten Forums
  • Eight Forums
  • Seven Forums
  • PC Help Forum
  • Help Me Bake
  • Site Links
  • Contact Us
  • Privacy and Cookies
  • About Us
    Windows Vista Forums is an independent web site and has not been authorized, sponsored, or otherwise approved by Microsoft Corporation. "Windows 10" and related materials are trademarks of Microsoft Corp.

    Designer Media Ltd
    All times are GMT -5. The time now is 20:25.
    .