Hot answers tagged windows-service
43
This can also be done via an elevated command prompt using the sc command. The syntax is:
sc config [service name] depend= <Dependencies(separated by / (forward slash))>
Note: There is a space after the equals sign, and there is not one before it. So if you want ServiceA to depend on both ServiceB and ServiceC--that is to say, ServiceA will not ...
28
The poster wants to ensure the service is stopped before trying to restart it. You can use a loop on the output of "sc query" doing something like this:
:stop
sc stop myservice
rem cause a ~10 second sleep before checking the service state
ping 127.0.0.1 -n 10 -w 1000 > nul
sc query myservice | find /I "STATE" | find "STOPPED"
if errorlevel 1 goto ...
26
Under the Services application, select the properties of the service in question.
View the recovery tab - there are all sorts of options - I'd set First & Second Failure to Restart the Service, Third to run a batch program that BLAT's out an email with the third failure notification.
You should also set the Reset Fail Count to 1 to reset the fail count ...
22
You can add service dependencies by adding the "DependOnService" value to the service in the registry using the regedit command, services can be found under HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\<Service name>. The details can be found at MS KB article 193888, from which the following is an excerpt from:
To create a new ...
20
Many executing components of Windows are implemented as services (see all services on your machine opening Control Panel > Administrative Tools > Services). These are specialized programs running in the background. They are not started by the logged-in user, but my the operating system itself.
Most services aren't stand-alone executables (EXE ...
18
There doesn't appear to be a GUI-based way of doing this unless you're joined to a domain - at least not one I could find anywhere - so I did a bit more digging and I've found an answer that works for our sitaution.
I didn't understand what the string representation meant in the knowledge base article, but doing a bit of digging led me to discover that it's ...
16
svchost, hosts services in Windows See KB. If you use Process Explorer you can see which services are being ran inside a particular process.
14
Delayed start has two major components:
Delayed services wait to start until all of the Automatic services have started
Initially, the threads for delayed services are set to lowest priority.
This greatly reduces the slowdown in responsiveness in user sessions that the services might otherwise cause, because their disk I/O, CPU time, and pace of ...
13
You're looking for:
sc config <servicename> obj= <accountname> password= <password>
The "sc" command will work on remote machines, too. Start it with no arguments to get more info. (It's a bit odd in requring spaces after many of the arguments. I can't say I've seen a similiar command-line program.)
10
Sure thing. Provided you're logged-on with an account that has "Administrator" rights on the remote server, just do:
sc \\remote-server stop service-name
and
sc \\remote-server start service-name
The sc command runs asynchronously to the service control manager, so you may want to query the service with the command below to insure it actually stopped ...
9
you could use the sc command-line tool but i don't know how to do it specifically in python.
http://stackoverflow.com/questions/133883/stop-and-start-a-service-via-batch-or-cmd-file/133926#133926
DESCRIPTION:
SC is a command line program used for communicating with the
NT Service Controller and services.
USAGE:
sc [command] ...
7
View the properties of the service and you'll see a "Service Name" and "Display Name". The display name is the one you see in services.msc, you need to use the service name with the net command however. Sometimes they're very different for example "Extensible Authentication Protocol Service" is the display name and "EapHost" is the service name.
7
Svchost is short for "Service Host". It keeps most of the Services on your machine running. There will be a few Services that host themselves in their own .exe file, but most of Windows' Services need to be hosted inside a svchost.exe process. The Services on your machine handle important stuff like networking, RpC server, audio, event log etc.
Type ...
7
Of course you can't run a service like that. Did you try using srvany in server 2008? As far as I know there is no 'official' version of srvany for s2k8, but you can always try, can you not?
EDIT: Oh, I forgot! We also use FireDaemon to run non-service applications as services. Though, it is not free and its functionality is a bit too much for your needs.
7
I just had the same problem.
You could use SubInACL.exe from the Resource Kit. Download the standalone utility here:
http://www.microsoft.com/download/en/details.aspx?displaylang=en&id=23510
Use msiexec /a PathToMSIFile /qb TARGETDIR=DirectoryToExtractTo to extract the files if you don't want to install the .msi
Open a command prompt as ...
7
It sounds like there is a group policy that defines the accounts that are granted Log on as a Service. Because you are an administrator you have permission to grant this privilege, but when the group policy re-applies the privilege will get removed. The next time the service stops it won't be able to start.
You should either change the scope / filtering ...
7
The security event-log on the 2008 server should record the denied login attempt, which should also include whatever name it attempted to log in with. This is likely your best bet for figuring out what the service is trying to log in as.
Secondly, I believe if you have it logging in as 'Local System' it doesn't have off-machine access. For that you'll need ...
6
Change the Apache service to be dependant on W3SVC. From an elevated command prompt:
sc config ApacheServiceName depend= W3SVC
Note the space after the equals next to "depend". It needs to be there. Replace ApacheServiceName with the service name (not the display name) of your apache service.
6
Use the "RunAs" commandline tool, it lets you supply an explicit credential set, and supports both "Domain\Username" and UPN formatting, allowing you to authenticate as another user and the run your command:
Runas /user:Domain\user "sc \\remoteServer stop serviceKeyName"
Alternative:
Set up a scheduled task with a specific logon account
6
I don't know about Windows 7, but the SC and SrvAny utilities from the Windows Server 2003 resource kit still worked on Server 2008 the last time I checked; I've used this technique myself to get PDFCreator running as a service on our file/print box:
Grab "srvany.exe" from the Server 2003 Resource Kit and copy it to your Server 2008 box.
Use "sc" to create ...
6
On which Windows release?
On recent ones, sc.exe is your friend here.
sc start ServiceName
sc stop ServiceName
sc config ServiceName option= value
The last one lets you set many things, amongst them the startup type and the service's logon user account (and password).
sc is odd in that, when using the config argument a space must follow each argument's ...
6
Figured it out myself:
It is actually the value in Software\Microsoft\Windows\CurrentVersion\Internet Settings\Connections\DefaultConnectionSettings that is used.
Since that is not easily modified, you can modify the proxy settings for a user, export the registry key, modify the path in the exported file to HKEY_USERS\S-1-5-18 and reimport it.
5
I'm not sure what you've tried to do before, but here's what I just did and had success:
1) Downloaded the Tomcat 5.5.27 Windows Service installer and installed it.
2) Dumped the TomCat5 service security descriptor using "sc sdshow tomcat5", which showed me:
...
5
Sorry for the late responce with this. I was trying to figure this out today. I came across this answer, figured I let SF know.
You can actually ...
Add this to your VMX config file to set VMWare Player not show the UI:
msg.noOk = "TRUE"
Get instsrv.exe from a Windows Server Resource Kit to create your own service
On Startup have a batch file call the ...
5
The fact that the machine with the shared drive is not on a domain is where your main problem is. In order to get this to work you will have to configure the Windows Service to run as a specific user, and then you'll have to create an identical user on the remote system with the same password. It might work then.
The problem stems from the fact that in ...
5
That's exactly what "services" are for in a Windows system.
Regarding the console/GUI thing: there was an option for services to enable them to interact with the system's console, so a service could have been allowed to display windows on the system. But this feature has been removed in Windows Server 2008, so, no, in Windows Server 2008 R2 there's no way ...
5
Your syntax is actually incorrect, but you'll be forgiven for missing it.
From the help text for sc create:
NOTE: The option name includes the equal sign.
What isn't immediately obvious from this is that the options need to be specified with a space between the option name and the value.
Incorrect:
displayname="Subversion"
Correct (note the space ...
5
Backup software should run as "a user with the lowest privilege level required in order for it to read & back up all of the files you want backed up".
Typically this means root (or some other UID 0 account) on Unix systems, and a member of the Backup Operators group on recent versions of Windows.
Some Windows backup software that doesn't take advantage ...
5
Stop it and disable it.
sc stop wuauserv
sc config wuauserv start= disabled
The space after the start= is mandatory, sc will complain if the space is omitted. It may be worth noting that any services, or programs, which depend upon a disabled service will themselves fail to start, or experience anomalous behavior.
Check the System event log for event ID ...
Only top voted, non community-wiki answers of a minimum length are eligible