HostWeb Forums » Microsoft Server Operating Systems » microsoft.public.win2000.file_system » Help with scripting

Topic: Help with scripting

Reply | New Topic | This is SPAM | This is Offensive

Submitted: 3/18/2008 10:03:08 AM

By: Anonymous
I am trying to query for services that start with TSM xxxx then stop the
services in the start state without have to write a net stop for every TSM
service. After which I will find the ones in a stopping state and use
taskkill to end the task and I am having problem accomplishing this task. I
am not a scripting guy and I need any help i can get with this

Replies below ↓

Replies

Reply | New Topic | This is SPAM | This is Offensive

Submitted: 3/18/2008 10:28:48 AM

By: Pegasus \(MVP\)

Re: Help with scripting


"slawal" <slawal@discussions.microsoft.com> wrote in message
news:CDAC3E4A-2CB1-4751-8DB4-8E05931E0AB1@microsoft.com...
>I am trying to query for services that start with TSM xxxx then stop the
> services in the start state without have to write a net stop for every TSM
> service. After which I will find the ones in a stopping state and use
> taskkill to end the task and I am having problem accomplishing this task.
> I
> am not a scripting guy and I need any help i can get with this

Try this:
@echo off
for /F "tokens=*" %%* in ('net start ^| find /i "TSM"') do echo net stop
"%%*"

Please note:
- You must remove the word "echo" in the second line to activate
the batch file.
- You cannot use taskkill.exe to end a service. Taskkill will only
kill tasks.



Contents
Home
Forums
About Us
Contact Us
Web Hosting:
Hosting Providers
How to choose a name
What is a Hosting Provider
Hosting Types
Choosing the right plan
 
Search
 
Login to HostWeb.com
Email
Password
If you do not have an account with us yet, join now - it's FREE!