calin radoni's humble web presence |
homedocstoolboxabout |
Command Line Usefull Tools
Not quite often, I have only command prompt access to Windows hosts. It is time consumming to search again and again after command line tools and their usage, so this document may fill some gaps.
Here are some the ipconfig
's paramaters:
The netsh
tools is very powerfull in Windows world. Changing a static IPv4 address is trivial.
netsh local static <the-new-IPv4-address> <the-new-mask> <the-new-gateway> <the-metric>Example:
netsh local static 192.168.1.2 255.255.255.0 192.168.1.1 0
By issuing the command net user
you will get the list of local users
To add the "johndoe" user with the password "DoeJohn" and the full name "John Doe":
net user johndoe DoeJohn /add /passwordreq:yes /fullname:"John Doe"and making it a member of the "SomeUsers" group:
net localgroup SomeUsers johndoe /add
The net user
and net localgroup
have many other options.
For domain based groups there is the net group
command.
To map the "Public" share from the "192.168.1.1" server as the local disk "N":
net use N: \\192.168.1.1\PublicIf you want to use a different user, let's say "johndoe":
net use N: \\192.168.1.1\Public /user:johndoe
The C:\Windows\System32\tsshutdn.exe
utility can be used to shutdown or restart a Windows (2000, XP, 2003) computer
from command line.
According to Microsoft's
KB320188, the usage is:
tsshutdn wait_time [/server:server_name] /reboot /powerdown /delay:log_off_delay /vwhere:
Operational mode
To see the firewall's state, configuration and working mode issue the following commands:
netsh firewall add portopening <protocol> <port> <descriptiveName> [mode] [scope [addresses]] [profile]where:
netsh firewall delete portopening <protocol> <port>where the <protocol> and <port> have the same meaning as in the previous command.
netsh firewall add portopening TCP 99 "99 tcp port" enablewill open the TCP port 99, enable this exception and set it's friendly name to "99 tcp port". The scope is ALL and the profile is CURRENT.
netsh firewall add portopening TCP 99 "99 tcp port" disablewill disable the "99 tcp port" exception.
netsh firewall delete portopening TCP 99will delete the exception defined in the first example.
The automatic update client application have the following command line options:
wuauclt
application.
This document is copyrighted (c) 2007 by Calin Radoni. Permission is granted to copy and/or distribute this document.
No liability for the contents of this document can be accepted. Use the concepts, examples and information at your own risk. There may be errors and inaccuracies that could be damaging to your system. Proceed with caution, the author do not take any responsibility.
All copyrights are held by their respective owners, unless specifically noted otherwise. Use of a term in this document should not be regarded as affecting the validity of any trademark or service mark. Naming of particular products or brands should not be seen as endorsements.