?
Solved

Stopping dependant service via script server 2008

Posted on 2011-09-19
1
Medium Priority
?
353 Views
Last Modified: 2012-05-12
Hi,

I need to restart a Backup exec remote agent service on a Server 2008 every day and would like to use a script for this. Unfortunately there is another service which depends on the one mentioned above.

This results in a need for user input (a 'Y' and [enter]) to the dependant service to restart aswell. I've spent several hours trying to get the required input sent to the command prompt (mainly using .sendkeys), but somehow I can't get the command prompt window activated (tryed appactivate). I can get the required charaters sent if I manually active the command prompt window first.

Can anyone help me with this? I've added my final attempt at the script below (and yes, I'm very much a novice with scripting :) ). I've left out the part stoping the service, I'm just concentrating on sending the char.

option explicit
Dim objShell
set objShell = WScript.CreateObject("WScript.Shell")
objshell.run "cmd.exe /k title cmd"
wscript.sleep 2000
objshell.appactivate "cmd"
objshell.sendkeys "y"
0
Comment
Question by:farodane
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
1 Comment
 
LVL 14

Accepted Solution

by:
setasoujiro earned 1000 total points
ID: 36560159
it would be easier to go as follows:

net stop "dependant service name"
net restart "backup exec service"
net start "dependant service"

save as .bat
0

Featured Post

How Blockchain Is Impacting Every Industry

Blockchain expert Alex Tapscott talks to Acronis VP Frank Jablonski about this revolutionary technology and how it's making inroads into other industries and facets of everyday life.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Redirected folders in a windows domain can be quite useful for a number of reasons, one of them being that with redirected application data, you can give users more seamless experience when logging into different workstations.  For example, if a use…
This article explains how to install and use the NTBackup utility that comes with Windows Server.
This tutorial will walk an individual through the steps necessary to configure their installation of BackupExec 2012 to use network shared disk space. Verify that the path to the shared storage is valid and that data can be written to that location:…
This tutorial will walk an individual through locating and launching the BEUtility application to properly change the service account username and\or password in situation where it may be necessary or where the password has been inadvertently change…
Suggested Courses

765 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question