Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Ending a task from a batch: possible?

Status
Not open for further replies.

Ratch

MIS
Mar 15, 2002
2
US
Hi all,

See bottom for direct access to question without background!

I'm trying to set up a server that's 100% automated in it's own maintenance, and it's primary functions.

It will be an off-site data backup server, connecting via scripted VPN client over a DSL line, then running several functions before disconnecting.

I want to be alerted if I'm online and the machine happens to come online at the same time, just in case I want to hop in and do some maintenance or checking up. I set up AOL's instant messenger with a profile for that machine and have it all set to automatically connect via batch command. TO disconnect, I'm counting on the momentary interruption of the VPN client's disconnect to knock IM off and not sign on automatically.

However, ending the task would be much cleaner!

Basically, does anyone know a command and syntax for killing a process at the command line level, so it can be done through a scheduled command line batch?
Win2k server is the OS.

Thanks in advance for any replies!
 


ratch,

If you know the process name you can use this piece of code:

For each Process in GetObject("winmgmts:{impersonationLevel=impersonate}").InstancesOf("win32_process")
If ucase(Process.Name) = "MYPROCESSNAME" Then
Process.Terminate Process.ProcessID
End If
Next

fengshui_1998
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top