Launch User account window from Run command

Wednesday, October 21, 2009 0 comments

All user accounts related operations have to be done in User Accounts window which can be opened from Control Panel. Instead we can open this tool from Run window by executing nusrmgr.cpl.


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:

C:\Documents and Settings\user>net start
These Windows services are started:

   Application Layer Gateway Service
   Automatic Updates
   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

The command completed successfully.  

Launch new share creation wizard command line

Monday, October 19, 2009 0 comments

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.


C:\>time
The current time is: 16:40:24.34
Enter the new time:
C:\>

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 *

Launch Disk Management tool from command prompt

We can open disk management console from command prompt by running diskmgmt.msc.

c:> diskmgmt.msc


what is my IP address?

Friday, October 16, 2009 0 comments

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

Wednesday, October 14, 2009 1 comments

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
The Security Center service is starting.
The Security Center service was started successfully.
c:\>



Launch event viewer from windows command prompt

We can lauch windows event viewer from command prompt by running eventvwr.msc command.

c:>eventvwr.msc


Launch windows security center from command line

We can launch windows security center wizard from command line using wscui.cpl command.

c:>wscui.cpl


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



snapshot of Paint application in Windows Vista

Launch System properties from command line

Monday, October 12, 2009 1 comments

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:


C:\>attrib 1.exe
A  S       C:\1.exe
C:\>attrib -S 1.exe
C:\>attrib 1.exe
A          C:\1.exe
C::\> 



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:

C:\>attrib 1.exe
A          C:\1.exe
C:\>attrib +S 1.exe
C:\>attrib 1.exe
A  S       C:\1.exe
C:\>

Launch disk cleanup tool from command line

Wednesday, October 7, 2009 0 comments

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>net stop webclient
The WebClient service is stopping.
The WebClient service was stopped successfully.

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
The WebClient service is starting.
The WebClient service was started successfully.

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.

C:\Users\Techblogger>net start webclient
System error 5 has occurred.

Access is denied.

C:\Users\Techblogger>

Join computer to domain from command line

Sunday, October 4, 2009 0 comments

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.

attrib -H filename

Example:

attrib -H examplefile.doc

Set hidden attribute from command prompt

Using attrib command we can mark a file as hidden from command prompt.

atttrib +H filename

Example:

attrib +H file1.doc
The above command will mark file1.doc as a hidden file.

Open display properties from command line.

Saturday, October 3, 2009 0 comments

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.


c:>desk.cpl

Set archive attribute from command line

We can set archive attribute for a file or folder from command line as given below.

attrib +a  filename


example:

attrib +a  data.doc

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.

attrib +R  filename

Example:

attrib +R file.doc

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