Help me, please

Hello, my name is Vinnie and i'm new at this forum and I know quite a bit VB2005 and I'm 14 y/o.

I'm running a gameserver wich needs a daily restart. And I'm too lazy to restart this server all by myself every single day. That's why I have builded a program called: PowerTimerc.

Here's a picture of my program while debugging:

http://img80.imageshack.us/img80/1852/pt7fa.png


It has the current time: "huidige tijd", the start time: "Start tijd" and the stop time: "Stop tijd"

All these times can be set. And I think I made it solid. Because  you can't get a higher number then 25 or 61 and it will drop a format exception when filling in letters.

The start time starts up a program when the current time is equal to the start time. When it's equal it starts up a program by a pre-filled-in textbox with the path to that program. You can browse if you want.

My question to you:

How can you shut down a program at a path: for example: "C:\Windows\Cmd.exe"

Thanks....




Answer this question

Help me, please

  • Baolong Chai

    I'll try that later because I'm not at home right now!

    But thanks for your reply. and your nice piece of coding ;) You'll hear from me if your code works!



  • Hanna Sofia

    Try this:
    Imports System.Diagnostics
    ...
    Dim procs() As Process = Process.GetProcesses
    For Each proc As Process In procs
    If proc.ProcessName <> "System" AndAlso proc.ProcessName <> "Idle" AndAlso _
    String.Compare(proc.MainModule.FileName, "c:\windows\system32\cmd.exe", True) = 0 Then
    proc.Kill()
    Exit For
    End If
    Next



  • Help me, please