Runasservice windows 8




















Which the answer to this question definitely is. Also bear in mind this is the first Google result when searching for "windows start batch file as a service", so whether it's within the narrow scope that some moderators thing is 'on topic' the rest of the world thinks it is.

I vote for pragmatism over dogmatism here. A similar question can be found at serverfault serverfault. Add a comment. Active Oldest Votes. Improve this answer. NSSM does not suck indeed! Junior M Thanks!! You saved me. I have spent 4 hrs for this. Yes, I know, whitelisting That's the sad truth.

Show 4 more comments. Why not simply set it up as a Scheduled Task that is scheduled to run at start up? Stephen Martin Stephen Martin 9, 3 3 gold badges 24 24 silver badges 34 34 bronze badges.

I have a number of batch files doing backups via robocopy that I start via the Scheduled Tasks go to Control Panel, Scheduled Tasks running on a Win server. Works a treat Plus the Task Scheduler provides lots of options for triggers, conditions, etc. Scheduled tasks are notoriously unreliable - I've actually come across this question because of all the problems I've been having with tasks not launching on time for no apparent reason.

Note that if you change your account password, all scheduled tasks created to use this account silently stop running apart from errors in the system log. If you change it, the login fails. You can create a special backup-user with a fixed, non-expiring password.

I am still wary of the scheduler because I had it stop working for some other reason after a few months. I forget why. It seems fragile. Haven't dug into this yet but this thread experienced the same thing and solved it using nssm to install the service. Windows appears to not run. In my case the files the batch file is supposed to create are not created and the programs are not running, so I have to assume it's not starting it. I managed to work around it by creating the service to run cmd.

Note that I'm using Windows 10, so this may be some new "security" thing. Get " Error The service did not respond to the start or control request in a timely fashion.

If running from powershell, use the full filename sc. Could not load branches. Could not load tags. Latest commit. Git stats 8 commits. Failed to load latest commit information. Oct 1, Updated to. NET framework 4. Oct 4, Add project files. View code. RunAsService RunAsService is a command line tool that allows you to setup a regular console application to run as a service.

You might choose to give it a different name than the executable to keep some kind of existing convention, make it friendlier or make it easier to use with commands like 'net start' and 'net stop' Display Name This is how the service name will be displayed in the windows services list. If no display name is specified it will default to Name, if Name is not specified, it will default to the name of the executable.

The primary advantage of running an app as a service is that you can have a program start before a user to log in. A perfect example of this is Plex , a media server app that can stream local content to just about any device you own. Sure, you could let it sit in the system tray like a normal program, but what if the computer restarts due to a power outage or scheduled updates?

Setting up Plex as a Service would solve that problem. Before getting started, you should be aware of a couple of important caveats to running an app as a service:. There are several out there, but our favorite is SrvStart. To get started, head over to the SrvStart download page and grab the utility. Fire up Notepad and create your configuration file using the format below.

The startup command simply specifies the path where the executable file resides. Save the new configuration file wherever you like, and replace the. For ease of typing at the Command Prompt, we suggest saving this file temporarily right on your C: drive. Your next step is using the Windows Service Controller SC command to create the new service based on the criteria in your configuration file.

There are a couple of things to note in that command. Yes, you read that right: I used C:PlexService. The command requires you to remove the slash.

From this point on, your new service will run whenever Windows starts. Use Google Fonts in Word. Use FaceTime on Android Signal vs. Customize the Taskbar in Windows What Is svchost. Best Smartwatches.

Best Gaming Laptops. Best Smart Displays. Best Home Security Systems.



0コメント

  • 1000 / 1000