Contacts

Start the service from the command line. Starting and configuring a Windows service from the command line

Despite its primitive appearance and modest size, the command line provides many variations on the theme “What if... start a service from command line" In fact, the average person will need it in very rare cases, if not at all, working with services (starting or stopping them) and even less often (although here it is more appropriate net command stop).

But, there are many talented young people, or simply insightful people, who will be very happy to stick their nose into your system. Of course, the majority of ordinary people will not pervert themselves using Windows NT or Windows 2000, and Seven is increasingly stepping on the throat of the “simple” XP, but the command line in the world of operating systems is exactly like the multiplication table in the world of finance.

The Control/Administration Panel contains the Services snap-in, which allows you to manage a number of services. Double-clicking on any of them allows you to view a number of options:

The General tab shows the status, startup type, description, executable file, and other information. Using CMD allows you to get similar information, as well as manage the state and startup of services using the command line:

Sc startServiceName– the service is started from the command line

Sc pauseServiceName– suspension of service

Sc continueServiceName– restoration of a suspended service

Sc stopServiceName– full stop

These commands can also be used on remote machines. For example, to launch the Remote Registry on a machine with the address 192.168.1.6., you need to enter (instead of IP you can also enter the machine name, for example Mailer):

The flag can take three values:

  • Auto – automatic start at system startup
  • Demand – manual launch
  • Disable - disable
Sc 192.168.1.6 config RemoteRegistry start= disable

here we have disabled RemoteRegistry on the remote machine. It is worth remembering that disabling the service does not stop it; after a reboot, it can start again.

On the Login tab you can see that the service can be launched either as a system account or as any other account. So that start the service from the command line under one or another account, the syntax is used:

In this example, the RemoteRegistry is loaded under the LocalService ( NT AUTHORITYLocalService), or you can use a system account ( LocalSystem), but it's better not to do this:

there's a flag here type=own says that the service is executed in its own process, but if the work occurs in a common process, then the flag is applied type=share. For example:

Using the command sc qcServiceName you can view detailed information about it, including the startup type, for example:

TYPE: 20 WIN32_SHARE_PROCESS (shared process)
or
TYPE: 20 WIN32_OWN_PROCESS (own process)

It may be necessary to launch a certain service using the command line, not on behalf of the system, but on behalf of the user, in which case you must specify the account name and password, for example:

sс config w3svc obj = User password = UserPass - here w3svc is configured to run as User with the password UserPass. The general syntax is:

sс config ServiceName obj =[Domain]User password= password - here Domain - the name of the domain where the account is located (optional). If the system service was previously configured for a local system, then when reconfiguring it for a domain account, you must use the flag type=own:

The Windows operating system contains many loopholes that allow you to penetrate it (including the script server), bypassing the standard rules. System services also play an important role here. For example, the utility PsExec allows you to log into a remote system or run an application on behalf of Local System. In the process, a service is created that runs on both machines, and it then operates the entire communication process. However, proud owners of the Seven, or even XP (if the necessary updates were installed), may be very disappointed. Although the psexecsvc service can be launched directly from the command line, the system simply ignores it (or prohibits its functions). Of course, if you have a head, then you can create an analogue of Psexec (especially since the operating algorithm is known), maybe it will work, but if everything was as they say in the book...

Good afternoon, dear readers and subscribers of the blog, today we will talk to you about how to open msc windows snap-in via the command line, why you might need it and how it will help in the daily practice of a system administrator. Trust the knowledge gained in this article, in the future they will be able to save you a huge amount of time and nerve cells, not to mention the opportunity to show off your nerdy knowledge in front of your colleagues, just if you actively use linux systems and you know the basic commands in the console, then you will be interested in these too. Always, if possible, try to study beyond GUI interfaces, as well as alternative configuration methods, since when setting up Windows Server, they are increasingly choosing the core mode with a minimalist interface.

What is msc snap-in

And so msc in Windows stands for Microsoft System Console; even simpler, these are windows, or as they are also called snap-ins, for managing certain functions of the operating system. Previously, I already introduced you to the method of creating a convenient mmc snap-in, in which we added everything we needed system administrator for daily administration.

And you’ll probably ask, what does the command line and all that have to do with it, but here’s what it has to do with it. Let's imagine a situation, you have an Active Directory domain in your organization, ordinary users do not have local administrator rights on their workstations, everything goes and works like clockwork, a situation happens that, for example, you need to change some settings for a user, and you need to do it now , so look for these settings in group policy no time. What to do, logging in is not an option, since you need to make changes in another user profile, and how to open, for example, the Computer Management or System snap-in.

This is where knowing the names of msc windows snap-ins and the command line will help us. All you need to do is open the command line as an administrator and enter the desired name of the msc snap-in. Below is the list. As you can see, by opening the command line cmd.exe, for example, I entered the value that opens the control panel with system administrator rights.

MSC Management Console equipment elements

  • appwiz.cpl- Installation and removal of programms
  • certmgr.msc- Certificates
  • ciadv.msc- Indexing service
  • cliconfg- SQL Network Client Program
  • clipbrd- Clipboard
  • compmgmt.msc- Computer management
  • dcomcnfg- DCOM component management console
  • ddeshare- DDE Shares (does not work on Win7)
  • desk.cpl- Screen properties
  • devmgmt.msc- Device Manager
  • dfrg.msc- Disk defragmentation
  • diskmgmt.msc- Disk management
  • drwtsn32- Dr.Watson
  • dxdiag- DirectX Diagnostic Service
  • eudcedit- Personal symbol editor
  • eventvwr.msc- Event Viewer
  • firewall.cpl- Windows firewall settings
  • gpedit.msc- Group Policy
  • fsmgmt.msc - Shared folders
  • fsquirt- Bluetooth File Transfer Wizard
  • chkdsk- Disk check (usually launched with parameters drive_letter: /f /x /r)
  • control printers- Printers and faxes - does not always start
  • control admintools- Computer administration - does not always start
  • control scheduled tasks- Scheduled tasks (scheduler)
  • control userpasswords2 - Account Management
  • compmgmt.msc- Computer management ( compmgmt.msc /computer=pc - remote control PC computer)
  • lusrmgr.msc - Local users and groups
  • mmc- creating your own equipment
  • mrt.exe- Malware removal
  • msconfig- System setup (autostart, services)
  • mstsc- Remote Desktop Connection
  • ncpa.cpl- Network connections

  • ntmsmgr.msc- Removable memory
  • mmsys.cpl- Sound
  • ntmsoprq.msc- Removable RAM operator requests (for XP)
  • odbccp32.cpl- Data Source Administrator
  • perfmon.msc- Productivity
  • regedit- Registry editor
  • rsop.msc- Resulting policy
  • secpol.msc- Local Security Settings (Local Security Policy)
  • services.msc- Services
  • sfc /scannow- System file recovery
  • sigverif- File signature verification
  • sndvol- volume control
  • sysdm.cpl- Properties of the system
  • syskey - Account database protection
  • taskmgr- Task Manager
  • utilman Utility Manager
  • verifier Driver Verification Manager
  • wmimgmt.msc- WMI management infrastructure

List of msc snap-ins for Windows Server

Let's look at how to launch Windows Administrative Snap-ins from the command line cmd.exe

  • domain.msc - Active Directory domains and trust
  • dsa.msc - Active Directory Users and Computers
  • tsadmin.msc - Terminal Services Manager
  • gpmc.msc - GPO Management Console (Group Policy Management Console)
  • gpedit.msc - Group Policy Object Editor
  • tscc.msc - Setting up a terminal server (TS Configuration)
  • rrasmgmt.msc - Routing and Remote Access
  • dssite.msc - Active Directory Sites and Trusts
  • dompol.msc - Domain Security Settings
  • dсpol.msc - Domain controller security policy (DC Security Settings)
  • dfsgui.msc - Distributed file system DFS (Distributed File System)
  • dnsmgmt.msc - DNS
  • iscsicpl.exe - ISCSI Initiator
  • odbcad32.exe - ODBC 32-bit data source administrator
  • odbcad64.exe - ODBC 64-bit data source administrator
  • powershell.exe -noexit -command import-module ActiveDirectory - Powershell Active Directory module
  • dfrgui.exe - Disk optimization
  • taskschd.msc /s - Task Scheduler
  • dsac.exe - Active Directory Administrative Center
  • printmanagement.msc - Print management
  • vmw.exe - Volume Activation Tool
  • eventvwr.msc /s - Event Viewer
  • adsiedit.msc - ADSIedit Editor
  • wbadmin.msc - Archiving system Windows data Server
  • ServerManager.exe - Server Manager

As you can see, the msc windows snap-in is very useful tools system administration. I even find it faster to open some snap-ins than to click on a bunch of windows with the mouse, especially if the server or computer is slow or there is no mouse. And in any case, it is always useful to know such things. Most of everything we use is stored in c:\Windows\System32. If you go to this folder you can find a lot of interesting things.

nbtstat -a pc- username of the user working on the remote PC machine
net localgroup group user /add- Add user to the group group
net localgroupgroup user/delete- Remove user from group
net send pc ""text"" - send a message to a PC user
net sessions- a list of users
net session /delete- closes all network sessions
net use l: \\computer name\folder\- to plug network drive l: folder on the remote computer
net user name /active:no- block the user
net user name /active:yes- unblock the user
net user name /domain- information about the domain user
net user Name /add- add user
net user Name /delete- delete user
netstat -a- list of all connections to the computer
reg add- Add a parameter to the registry
reg compare- Compare parts of the registry.
reg copy- Copies from one partition to another
reg delete- Removes the specified parameter or section
reg export- Export part of the registry
reg import- Accordingly, import part of the registry
reg load- Loads the selected part of the registry
reg query- Displays the values ​​of a given registry branch
reg restore- Restores the selected part of the registry from a file
reg save- Saves the selected part of the registry
reg unload- Unloads the selected part of the registry
shutdown- shutting down a computer, you can turn off another one remotely.
SystemInfo /s machine- will show a lot of useful information about the remote machine

List of commands for Windows Control Panel items

  • control /name Microsoft.AutoPlay - Autoplay
  • control /name Microsoft.OfflineFiles - Offline files
  • control /name Microsoft.AdministrativeTools - Administration
  • control /name Microsoft.BackupAndRestore - Backup and restore
  • control /name Microsoft.WindowsFirewall - Windows Firewall Windows
  • control /name Microsoft.Recovery - Recovery
  • control /name Microsoft.DesktopGadgets - Desktop Gadgets
  • control /name Microsoft.DateAndTime - Date and Time
  • control /name Microsoft.DeviceManager - Device Manager
  • control /name Microsoft.CredentialManager - Credential Manager
  • control /name Microsoft.HomeGroup - Home group
  • Windowscontrol /name Microsoft.WindowsDefender - Windows Defender
  • control /name Microsoft.Sound - Sound
  • control /name Microsoft.NotificationAreaIcons - Notification area icons
  • control /name Microsoft.GameControllers - Gaming devices
  • Keyboardcontrol /name Microsoft.Keyboard - Keyboard
  • control /name Microsoft.Mouse - Mouse
  • control /name Microsoft.TaskbarAndStartMenu - Taskbar and Start menu
  • control - Control panel
  • control /name Microsoft.Fonts - “Fonts” folder
  • control /name Microsoft.IndexingOptions - Indexing options
  • control /name Microsoft.FolderOptions - Folder options
  • control /name Microsoft.PenAndTouch - Pen and touch devices
  • control /name Microsoft.Personalization - Personalization
  • control /name Microsoft.RemoteAppAndDesktopConnections - Remote desktop connections
  • control /name Microsoft.GetPrograms - Getting programs
  • control /name Microsoft.GettingStarted - Getting Started
  • control /name Microsoft.ProgramsAndFeatures - Programs and Features
  • сontrol /name Microsoft.DefaultPrograms - Default programs
  • control /name Microsoft.SpeechRecognition - Speech recognition
  • control /name Microsoft.ParentalControls - Parental Controls
  • control /name Microsoft.InternetOptions - Internet Options
  • control /name Microsoft.TextToSpeech - Speech Properties
  • control /name Microsoft.System - System
  • control /name Microsoft.ScannersAndCameras - Scanners and cameras
  • control /name Microsoft.PerformanceInformationAndTools - Performance counters and tools
  • control /name Microsoft.PhoneAndModem - Phone and modem
  • control /name Microsoft.ColorManagement - Color management
  • control /name Microsoft.Troubleshooting - Troubleshooting
  • control /name Microsoft.DevicesAndPrinters - Devices and Printers
  • control /name Microsoft.UserAccounts - Accounts users
  • control /name Microsoft.MobilityCenter - Mobility Center
  • control /name Microsoft.WindowsUpdate - Update Center
  • control /name Microsoft.ActionCenter - Action Center
  • control /name Microsoft.SyncCenter - Synchronization Center
  • control /name Microsoft.EaseOfAccessCenter - Ease of Access Center
  • control /name Microsoft.NetworkAndSharingCenter - Network and Sharing Center
  • control /name Microsoft.BitLockerDriveEncryption - Drive encryption
  • control /name Microsoft.Display - Screen
  • control /name Microsoft.PowerOptions - Power Options
  • control /name Microsoft.RegionAndLanguage - Language and regional standards

If you have anything to add to the list of msc canonical names, please write in the comments and I will add them.

Sometimes you may need to take control of Windows 10 services. To stop some services, start, disable a service, delay starting or resume or pause a Windows service. You must use the built-in tool in operating system Windows snap-in. This short article will show you how to start, stop or restart any service in Windows 10, using the Services Manager as well as the Command prompt.

Windows services usually start when the computer starts in the background. Roughly speaking, Services handle low-level tasks that typically do not require user interaction. In the Service Control Manager, you can start, stop, disable, delay starting Windows 10 Services. Let's look at how to do this in more detail.

Method 1: You can open Windows services using the Run dialog box.

Press the Win + R keyboard shortcut and type or copy and paste the command: services.msc in the dialog box "Run" and press Enter. This will open the snap "Service Manager".

Method 2: You can open Windows services using the menu WinX.

Right click on the button "Start" or press the Win + X key combination in the menu that opens, select "Computer Management" then go “Services and Applications” → “Services”.

Method 3: Open Windows Services Using Windows Search .

Open the Start menu and start typing the word Services on the keyboard, click on the mouse in the results found, this will open the equipment we need.

Method 4: Open Windows Services Using Classic Control Panel .

Open the classic Control Panel. Go

In the manager, you will see a list of services running on the system. You will also be able to view the status of any Service - Name, Description, Status(running or stopped), Startup type and etc..

Windows 10 offers four startup types:

  • Auto
  • Automatic (delayed start)
  • By hand
  • Disabled.

Start, stop, disable Windows 10 services.

To start, stop, pause, resume or restart any Windows services, select the service and right-click on it. You will be presented with these options. See screenshot.

If you want to control big amount options, double click on the service to open the window Properties.

In the drop down menu "Startup type", you can choose how the service you are editing will start.

In line State services, you will see buttons “Start”, “Stop”, “Pause”, “Continue”(Resume service).

In the Properties window, you will also see other tabs that offer additional options and information - “Login”, “Recovery” And "Dependencies".

Once you have made the changes you must click on the button "Apply" and, if necessary, restart the computer for the changes to take effect.

You can also use the command line to Start, Stop, Pause, and Resume any service.

Open a command prompt (as administrator) and run one of the following commands:

For example, the service is used

Start the service:

Net startservice

Stop the service:

Net stopservice

Suspend service:

Net pauseservice

Resume service:

Net continueservice


Share this article with your friends
Did you like the article? Share it