- Allows programs to run as background and startup services.
- There are classic (instsrv and srvany) and modern (sc.exe) methods to configure them.
- Caution is required when manipulating the registry and system paths to avoid errors.
Have you ever wondered how to run a program as a service in Windows via System32? This procedure may seem reserved for advanced users, but in reality, with the right instructions and attention to detail, it can be performed in different versions of Windows without complications. Windows services are applications that run in the background and, Often, they require special privileges or must be available even before a user logs on..
Today we're going to break down all the viable options for creating and running a mini Windows service, starting from the System32 folder, using the safest and most effective methods. We will explain both native tools and external utilities, Tricks for different versions of the operating system and recommendations to stay on track during the process. Let's go!
What does it mean to create a Windows service from System32?
A Windows service is a program capable of running in the background, managed by the operating system itself. Unlike other programs that start after logging in, services can run even if no user is logged in. Locate them in C: \ Windows \ System32 It is common for critical system services, although any executable located here may be available to all users, so it is a common location to install custom services.
Tools and utilities needed to create the service
To transform an application into a service in Windows, especially versions like XP, 2003, Windows 7, 8, 10, or even Server 2008, there are several options. Below, we summarize the most commonly used tools:
- instsrv.exe – Microsoft Resource Kit utility for installing or removing services.
- srvany.exe – Allows you to run any application as a service, even if it was not designed for that purpose.
- sc.exe – Line tool commands which comes integrated into Windows, used to create, configure and control services.
- Regedt32.exe/regedit.exe – Registry editors to adjust service paths and parameters.
The combination of these utilities will allow you to install custom services on your Windows system.
Classic method: using Instsrv.exe and Srvany.exe
The most classic method, still valid for many versions of Windows, consists of using Instsrv y Srvany, utilities provided by Microsoft in the Resource Kits.
You can find them as part of the Windows NT Resource Kit or download them from official Microsoft sites. You must copy both files to the folder System32 so that they are available from anywhere in the system.
The general procedure is:
- Open the command console (CMD) as administrator.
- Run the command:
instsrv.exe "NombreDelServicio" srvany.exe
For example:C:\Windows\System32\instsrv.exe Notepad C:\Windows\System32\srvany.exe - Edit the Windows registry to associate the executable you want to run as a service:
- Open the registry editor with regedit o regedt32.
- Navigate to
HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\. - Create a subkey called Parameters.
- In this key, create a value of type REG_SZ called Application. Its value must be the full path of the executable you want to launch as a service (for example,
C:\Windows\System32\notepad.exe).
- Save the changes and close the registry editor.
- Start the service from the Control Panel > Services or from the command line with:
NET START NombreDelServicio
This method is simple and very flexible, although it requires modifying the Windows registry, so it is advisable to create a backup before making any changes.
Modern method: Using SC.EXE to create services
In recent versions of Windows, including Windows 10 and Server, sc.exe It's the preferred tool for managing services via the command line. It allows you to create new services, set startup parameters, dependencies, and more, all from the console.
The basic syntax is:
sc.exe create "NombreServicio" binpath= "C:\Windows\System32\ejemplo.exe" start= auto
Main Parameters:
- binpath= Full path to the executable to be launched as a service (required).
- type= Process type (own: independent process, share: shared).
- start= Startup type (auto: automatic, demand: manual, disabled: disabled, delayed-auto: starts after a short delay for automatic services, boot/system: for drivers).
- depend= Specifies services this service depends on (if any).
- obj= User account under which the service runs (LocalSystem by default).
- displayname= Descriptive name that will appear in the services console.
Practical example to add a service that runs a file miapp.exe from System32:
sc.exe create MiServicio binpath= "C:\Windows\System32\miapp.exe" start= auto
With this method you don't need to edit the registry manually and you have full control from the command line.
Post-installation configuration and management
Once you've created your service, you can customize it to suit your needs:
- Change the startup mode (automatic, manual, or disabled) from services.msc or the console sc.exe config.
- Start or stop the service using the commands:
NET START NombreDelServicio
NET STOP NombreDelServicio - Remove the service if necessary with:
sc.exe delete NombreDelServicio
For services created with srvany/instsrv, you can edit the parameters in the registry to change the associated executable or its path.
Tips and tricks to avoid common problems
Creating services by modifying paths and executables can cause errors if certain precautions aren't followed. Here are some key tips:
- Always make a backup copy of the registry before any modification.
- Make sure the executable you are converting into a service is reliable and compatible with running as a service..
- If the service doesn't start, check the Windows event log for errors and possible insufficient permissions.
- Use user accounts with the minimum necessary privileges when creating critical services.
Always test services in test environments before deploying them to production systems.
Troubleshooting System32 and Windows Registry Errors
Sometimes, the very System32 directory or paths like config\systemprofile\Desktop can cause problems, especially after Windows updates or system crashes. If you're faced with messages like "C:\Windows\system32\config\systemprofile\Desktop is unavailable," try these methods:
1. Restore the default desktop path
From the file explorer press Win + E, right-click on the Desktop, select Properties > Location, and click “Restore Defaults.” This should resolve any issues with incorrect paths.
2. Copy the Desktop folder from the default user
Reveal hidden files, access C:\Users\Default\ and copy the Desktop folder to C:\Windows\system32\config\systemprofile. This way you recover the desktop for that profile.
3. Review the configuration from the registry
Opens regedit and check in HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\User Shell Folders that the value of Desktop points to C:\Users\%USERNAME%\Desktop and %USERPROFILE%\Desktop.
4. Create a new user account
If all else fails, create a new account from the control panel or using the command control userpasswords2 in CMD with privileges. Assign rights and move the old user's files.
5. Use the system file checker
Run sfc /scannow from CMD as administrator to search and repair corrupt files.
6. Update or reinstall Windows
If no solution works, an in-place upgrade or reinstallation can restore operation without losing important files.
Advanced Options: Complete Service Management with SC.EXE
For those looking to fully customize the behavior of a service, SC.EXE offers a set of parameters:
- type= to define whether the service is owned, shared, kernel, etc.
- group= to assign the service to a specific load group.
- tag= yes/no to get controller IDs.
- depend= defines services or groups on which the service depends.
- obj= to indicate the account under which it runs (useful for special permissions).
- displayname= to give a friendly name to the service.
- password = if the service requires different credentials.
A very complete example would be:
sc.exe create MiServicio binpath= "C:\Windows\System32\miapp.exe" type= own start= auto depend= +TDI NetBIOS obj= "NT AUTHORITY\\LocalService" displayname= "Mi Servicio de Prueba" password= "mi_clave"
This way, you can automate service installations across multiple devices, ideal for business environments.
Passionate writer about the world of bytes and technology in general. I love sharing my knowledge through writing, and that's what I'll do on this blog, show you all the most interesting things about gadgets, software, hardware, tech trends, and more. My goal is to help you navigate the digital world in a simple and entertaining way.