How Do I Make My Vb Executable Filel In To A Service So That It Starts As Soon As System Starts.
Also If This .exe File Is Closed, I Want To Shut The System.
Please Help.
How Do I Make My Vb Executable Filel In To A Service So That It Starts As Soon As System Starts.
Also If This .exe File Is Closed, I Want To Shut The System.
Please Help.
A quick clarification and a concise plan of action. A true Windows "service" is not the same as a startup shortcut or autoexec entry — s suggestion will simply run a program at logon (or very old DOS-style boots) and will not run in the service session. is correct to call that out. For a reliable, system-start service you have two practical choices: rewrite the work as a Windows Service, or run the existing EXE under a service wrapper.
If using .NET (VB.NET) the correct approach is to create a Windows Service (inherit ServiceBase) and put long-running work on a background thread or timer. Simple skeleton:
Imports System.ServiceProcess
Public Class MyService
Inherits ServiceBase
Protected Overrides Sub OnStart(args() As String)
' start worker thread or timer
End Sub
Protected Overrides Sub OnStop()
' stop threads, cleanup
End Sub
End Class Install it with a service installer or the sc tool, for example:
sc create MyService binPath= "C:\Path\MyService.exe" start= auto (note the required spacing in the sc syntax).
If the EXE is a VB6 or GUI app it cannot reliably run as a service (services no longer interact with the desktop). Options are: refactor the background logic into a service and keep any UI in a separate app; or use a wrapper like NSSM/srvany to run the EXE as a service (no UI), understanding this is a workaround and can be fragile.
About "shut the system if the EXE closes": implement that logic in the service monitor (watch the process and on unexpected exit call a controlled shutdown). Do not single-thread this; add a grace/retry period, logging, and ensure the service account has shutdown privileges. Safer alternatives: configure service-restart policies or notify admins instead of forcing shutdown.
Troubleshooting: use Event Viewer for errors, add logging, run service code in console mode for debugging (Environment.UserInteractive), and add service dependencies if it relies on SQL Server or network services (as implied). and point to wrappers — useful for quick tests, but refactoring to a proper service is the robust, future-proof solution.
Jump to Post— Buff 0How Do I Make My Vb Executable Filel In To A Service So That It Starts As Soon As System Starts.
Also If This .exe File Is Closed, I Want To Shut The System.
Please Help.
There are 2 easy ways - 1 put it in the startup menu of …
Jump to Post— WaltP 2,905There are 2 easy ways - 1 put it in the startup menu of windows by copying it there, 2 call it in autoexec.bat
Neither accomplish what the user wants. A "service" is not started via autoexec.bat nor startup menu.
Try the information at
How Do I Make My Vb Executable Filel In To A Service So That It Starts As Soon As System Starts.
Also If This .exe File Is Closed, I Want To Shut The System.
Please Help.
There are 2 easy ways - 1 put it in the startup menu of windows by copying it there, 2 call it in autoexec.bat
my system include the sql sever database. is there space required when i want to make it as setup
There are 2 easy ways - 1 put it in the startup menu of windows by copying it there, 2 call it in autoexec.bat
Neither accomplish what the user wants. A "service" is not started via autoexec.bat nor startup menu.
Try the information at
http://www.overclock.net/faqs/119474-how-run-program-service.html or .
If that doesn't quite do it, google for "run program as service" or something like that. You can find programs that will load the program as a service or instructions to do it yourself.
If still nothing, I'll post the instructions I used a while ago.
http://www.itsatechworld.com/2006/01/17/hamachi-vpn-solution/
this is an instruction I used for running several programs as services, I'm sure it can be customized for your particular software
have fun :)
Please download exe to service (just google it ) and install your exe file as service ... simple
We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.