Open Date and time properties window from command prompt
To launch date and time properties window from command prompt just run the command timedate.cpl
c:>timedate.cpl
Get the list of running services from command prompt
Windows provides command line support for almost all the operations related to services. Whatever you can do through services.msc you can do the same from command prompt too. It is just that you need to figure out which command we need to use for the required operation. And some operations are better be done from command prompt. For example we can't get the list of services running on the machine easily through services.msc console. Command prompt is better suited for this.
We can get the list of all services running on the machine very easily from command prompt. Just run Net start in the command window.
Example:
Application Layer Gateway Service
COM+ Event System
Cryptographic Services
DCOM Server Process Launcher
DHCP Client
Distributed Link Tracking Client
DNS Client
Error Reporting Service
ES lite Service for program management.
Event Log
Fast User Switching Compatibility
Help and Support
HID Input Service
IPSEC Services
Network Connections
Network Location Awareness (NLA)
Plug and Play
Print Spooler
Protected Storage
Remote Access Connection Manager
Remote Procedure Call (RPC)
Secondary Logon
Security Accounts Manager
Security Center
Server
Shell Hardware Detection
SSDP Discovery Service
System Event Notification
System Restore Service
Task Scheduler
TCP/IP NetBIOS Helper
Telephony
Terminal Services
Themes
WebClient
Windows Audio
Windows Firewall/Internet Connection Sharing (ICS)
Windows Management Instrumentation
Windows Time
Windows User Mode Driver Framework
Wireless Zero Configuration
Workstation
Launch new share creation wizard command line
Shared Folders wizard allows users to share folders on the local computer with other users. We can launch new share creation wizard from command line using the below command.
c:\> shrpubw
Running the shrpubw command from command prompt or from Run window will launch shared folder wizard like below. Below snapshot is captured on a Windows 7 system.
How to see time from command prompt
We can query the current time on the system from command promt also. We can just run the command 'time' for this.
Launch firewall configuration window from command line
We can launch firewall configuration window from command prompt by running the command firewall.cpl.
c:>firewall.cpl
Delete network drive from command line
We can delete mapped connection to a network share from command line. We can use 'net use' command for this. For example to disconnect the network share mapped to the drive z: we can run the below command.
net use /del Z:
Similarly to disconnect all the mapped drives we can run the below command.
net use /del *
what is my IP address?
You can know the IP address of your machine by running ipconfig command in the console.
C:\Documents and Settings\John>ipconfig
Windows IP Configuration
Ethernet adapter Local Area Connection:
Connection-specific DNS Suffix . :
IP Address. . . . . . . . . . . . : 192.168.1.5
Subnet Mask . . . . . . . . . . . : 255.255.255.0
Default Gateway . . . . . . . . . : 192.168.1.1
Open text file from command line
On a Windows machine, we can open a text file from command prompt by just giving the file name.
For example to open a text file named file1.txt, we just need to type file1.txt in the command prompt and press 'Enter'.
c:> file1.txt
Note that file name should have the extension as .txt otherwise command prompt would not be able to identify which application need to be used to open the file.
Start security center service from command prompt
Security Center service can be started from command line using net start command. Run the below command from windows command prompt.
net start wscsvc
C:\>net start wscsvc
Launch event viewer from windows command prompt
We can lauch windows event viewer from command prompt by running eventvwr.msc command.
Launch windows security center from command line
We can launch windows security center wizard from command line using wscui.cpl command.
Launch Paint from command line
We can launch MS Paint application from command prompt also. Just run the command mspaint and it will open paint application.
c:> mspaint
Launch System properties from command line
System properties window can be opened by opening My computer properties. To launch this directly from windows command prompt we can use sysdm.cpl command. Just run this command from command window and you can see system properties window.
c:>sysdm.cpl
Change my documents location from command prompt
We can change the target location of My Documents folder by editing the registry key. We can use reg.exe utility for this. An example for changing my documents location is given below.
reg.exe add "HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\Shell Folders" /v Personal /t REG_SZ /d "d:\mydocs" /f
The above command will set the target folder for my documents as d:\mydocs.
Clear system file from command line
We can unset the system file attribute of a file from command prompt. Find the command for this below.
attrib -S filename
Example:
Set system attribute from command line
We can set system attribute for a file from command prompt. See the syntax below.
attrib +S filename
Example:
Launch disk cleanup tool from command line
Using Disk cleanup tool we can easily identify unnecessary files strored in a drive and can delete them in a single go. This tool can be launched from disk properties windows in disk management console.
The same tool can be launched from command line too. Just run cleanmgr from command prompt and disk clean up tool will be launched and you will be asked to select the drive on which cleanup should be performed.
c:> cleanmgr
Here select the drive and click 'OK'.
Next you will be asked to select what kind of files need to be cleaned up.
Select appropritate categories in the above window and click 'OK' button.
Stop Webclient service from command line
Webclient service can be stopped from command prompt using the command 'net stop webclient'.
C:\Windows\system32>
Start webclient service from command line
We can start webclient service from command prompt using the below command
net start webclient
C:\>net start webclient
C:\>
Note that this command should be run from a login account with administator previliges. Additionally, on Vista and Windows 7, this should be run from an elevated command prompt. Otherwise you will get the following error.
Access is denied.
C:\Users\Techblogger>
Join computer to domain from command line
In this post it has been explained how to join a machine to a domain using Graphical User Interface(GUI). Some times we may have to do this from some script or programatically. We can use the tool Netdom.exe in such scenarios.
Below is the command we need to run for joining a machine to a domain.
netdom.exe join %computername% /domain:DomainName /UserD:DomainName\UserName /PasswordD:Password
Here Username and Password should be of a domain user having permissions to join a computer to the domain.
Netdom.exe can be downloaded from here
Controlling services from command line
We normally use Services.msc to start or stop or disable or enable any service. We can do the same from command line also using net and sc utilities. Below are commands for controlling the operation of a service.
To stop a service from command prompt:
net stop servicename
To start a service from command prompt:
net start servicename
To disable a service from command prompt:
sc config servicename start= disabled
To reenable a service from command prompt:
sc config servicename start= demand
To make a service automatic from command prompt:
sc config servicename start= auto
Note: Space is mandatory after '=' in the above sc commands.
Clear hidden attribute from command line
We can clear hidden attribute of a file using the below command.
Example:
Set hidden attribute from command prompt
Using attrib command we can mark a file as hidden from command prompt.
Example:
Open display properties from command line.
Display Properties is where we can configure look and feel of windows desktop. We can choose display theme, desktop wallpaper, screen savers, display resolution, windows appearance and size, text size on windows etc.
Display properties can be opened by right clicking on the desktop screen and then selecting Properties from the context menu.
This window can also be opened from command line. We need to run desk.cpl command for this.
Set archive attribute from command line
We can set archive attribute for a file or folder from command line as given below.
example:
The above command will set archive attribute for the file data.doc
Set read-only attribute from command line
We can mark a file as read-only from command line too. Command for this is given below.
Example:
The above command will set the read only attribute forthe file file.doc and user will not be able to do modifications to the file.
Clear archive attribute from command line.
We can unset archive attribute of a file using attrib command. Syntax is given below.
attrib -a filename
Example:
attrib -a example.doc
The above command will unset archive attribute for the file example.doc

