If you have Win2000 or higher the above script should do the trick... What OS are you running?

Another Example...

If servicestate("Norton Antivirus Server") = "Running"
...your code here...
endif