Sc create batch file service
Connect and share knowledge within a single location that is structured and easy to search. On Win2k3 I used the srvany. For the time being I've installed the srvany. Of course you can't run a service like that. Did you try using srvany in server ? As far as I know there is no 'official' version of srvany for s2k8, but you can always try, can you not?
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. Use NSSM to run a. BAT or any old. EXE file as a service. We use Task Scheduler to run task whenever the computer starts regardless a user is logged in or not. You can't just run a. BAT file or any old. Windows services don't work that you. The SC command just adds the required registry entries for a service - if the file you specify isn't a valid service exe it won't turn it into one.
Use "sc " to create a new service that launches "srvany " e. No quotes required. I stumbled upon this thing. It's very very easy to convert any. Try it. Execute bat file as a windows service Ask Question. Asked 4 years, 3 months ago.
Active 3 days ago. Viewed 15k times. This file should be called as a service. Sunny Sunny 1 1 gold badge 13 13 silver badges 32 32 bronze badges. This is impossible. KonstantinL No it is not impossible at all, but it is silly idea though. Add a comment. Active Oldest Votes. I would not do that. You could run the first batch file from a scheduled task. Shell" MyScript. The computer attempts to restart with the last-known good configuration. This could result in the computer being able to restart, but the service may still be unable to run.
If the last-known good configuration fails, startup also fails, and the boot process halts with a Stop error. No notification is given to the user beyond recording the error in the Event Log.
Specifies a path to the service binary file. Specifies the name of the group of which this service is a member. The default value is null. Tags are used only for boot-start and system-start drivers. Specifies the names of services or groups that must start before this service. Specifies a name of an account in which a service will run, or specifies a name of the Windows driver object in which the driver will run.
The default setting is LocalSystem. But there are limits to what SC will do. This means that:. Indeed, as an MP3 is not a valid application, it is no surprise that attempting to start the service results in failure:.
So, as we have shown, SC is firmly focused on basic installation — not operation. The fact that a service was created with SC does not mean that the service can ever start or run.
Even though SC will install any program as a service, the reality is that only specially constructed executables can actually operate as a service. We call those Service Applications. Service applications implement the Windows Services API — a set of operations used to control and monitor services. They are not Service Applications. There is simply no way for Windows to directly control or interrogate any of those desktop programs as a service.
0コメント