Categories
Bmail.exe CLI Command Line Linux SMTP Utility Windows

Command Line SMTP Mailer for Batch Jobs

Bmail is a free but lean command line SMTP mail sender. Don’t get fooled into playing $$$ for huge executables. Bmail allows the user to automate the sending of email messages containing log files, data downloads or error messages on Win32 based computers. Together with the freeware utility mpack, you can also send MIME encoded attachments.

Download and more information here.

Categories
CLI Command Line Linux Reboot Restart Scheduled Tasks Win 7 Win7 Windows Windows 7 Windows Vista Windows7 XP

Schedule Windows reboot (restart) from command line with schtasks

Schedule one-time reboot:

schtasks /create /tn “Reboot” /tr “shutdown /r /t 1” /sc once /st 01:00:00 /sd 08/18/2009 /ru “System”

Create scheduled task to run twice daily:

schtasks /create /tn “TTF” /tr “C:TempTttf.bat” /sc daily /st 06:00:00 /sd 08/25/2009 /ri 720 /du 720 /ru “System”

Create scheduled task to run every weekday, M-F:

schtasks /create /tn “Reboot” /tr “shutdown /r /t 1” /sc WEEKLY /d “MON, TUE, WED, THU, FRI” /st 01:00:00 /sd 08/18/2009 /ru “System”

To update an existing scheduled task run the same command as above with any desired modifications. You will be prompted with, “WARNING: The task name “Reboot” already exists. Do you want to replace it (Y/N)?”

Upon successful creation the OS will report, “SUCCESS: The scheduled task “Reboot” has successfully been created.”

You can also update an existing scheduled task from the Windows command line:

schtasks /change /tn “Reboot” /st 04:00:00 /sd 12/11/2009

Schtasks supports the following options
SCHTASKS /Change [/S system [/U username [/P [password]]]] /TN taskname
     { [/RU runasuser] [/RP runaspassword] [/TR taskrun] [/ST starttime]
       [/RI interval] [ {/ET endtime | /DU duration} [/K] ]
       [/SD startdate] [/ED enddate] [/ENABLE | /DISABLE] [/IT] [/Z] }

Description:
    Changes the program to run, or user account and password used
    by a scheduled task.

Parameter List:
    /S       system      Specifies the remote system to connect to.

    /U       username    Specifies the user context under which schtasks.exe
                         should execute.

    /P       [password]  Specifies the password for the given user context.
                         Prompts for input if omitted.

    /TN      taskname    Specifies which scheduled task to change.

    /RU      username    Changes the user name (user context) under which the
                         scheduled task has to run. For the system account,
                         valid values are “”, “NT AUTHORITYSYSTEM” or “SYSTEM”.
                         For v2 tasks, “NT AUTHORITYLOCALSERVICE” and
                         “NT AUTHORITYNETWORKSERVICE” are also available as well
                         as the well known SIDs for all three.
    /RP      password    Specifies a new password for the existing user
                         context or the password for a new user account.
                         This password is ignored for the system account.

    /TR      taskrun     Specifies the new program that the
                         scheduled task will run.

    /ST      starttime   Specifies the start time to run the task. The time
                         format is HH:mm (24 hour time) for example, 14:30
                         for 2:30 PM.

    /RI      interval    Specifies the repetition interval in
                         minutes. Valid range: 1 – 599940 minutes.

    /ET      endtime     Specifies the end time to run the task. The time
                         format is HH:mm (24 hour time) for example, 14:50
                         for 2:50 PM.

    /DU      duration    Specifies the duration to run the task. The time
                         format is HH:mm. This is not applicable with /ET.

    /K                   Terminates the task at the endtime or duration time.

    /SD      startdate   Specifies the first date on which the task runs.
                         The format is mm/dd/yyyy.

    /ED      enddate     Specifies the last date when the task should run.
                         The format is mm/dd/yyyy.

    /IT                  Enables the task to run interactively only if the
                         /RU user is currently logged on at the time the job
                         runs. This task runs only if the user is logged in.

    /RL      level       Sets the Run Level for the job. Valid values are
                         LIMITED and HIGHEST. The default is to not change it.

    /ENABLE              Enables the scheduled task.

    /DISABLE             Disables the scheduled task.

    /Z                   Marks the task for deletion after its final run.

    /DELAY   delaytime   Specifies the wait time to delay the running of the
                         task after the trigger is fired.  The time format is
                         mmmm:ss.  This option is only valid for schedule types
                         ONSTART, ONLOGON, ONEVENT.

    /?                   Displays this help message.

Schtasks Examples:
    SCHTASKS /Change /RP password /TN "Backup and Restore"
    SCHTASKS /Change /TR restore.exe /TN "Start Restore"
    SCHTASKS /Change /S system /U user /P password /RU newuser /TN "Start Backup" /IT

Categories
CLI Command Line Grep Linux Win 7 Win7 Windows Windows 2000 Windows 7 Windows Vista Windows7

Windows Command Line Tricks

Here are a few Windows command line tricks that might make your life easier.

Save A List of Files to a Text File by Extension

dir *.ext /s /b > files.txt

This command line will create a file called files.txt. When you open this file, there will be a complete list of all the files in that directory and all subdirectories with the .ext extension. You can then open up this text file in any text editor and work this the information.By changing the ext part, you can select different files. For example, if you wanted to list all of the PDF documents, you would type:

dir *.pdf /s /b > files.txt


Get Your IP Address Information

ipconfig /all

This will retrieve a pile of information about your network connection and IP information. From this command, you can get:

* Host Name
* Primary DNS Suffix
* Node Type
* IP Routing Enabled
* WINS Proxy Enabled
* DNS Suffix Search List
* Connection-specific DNS Suffix
* Network Adapter Description
* Physical (MAC) Address
* DHCP Enabled
* IP Address
* Subnet Mask
* Default Gateway
* DNS Servers


Get Installed Driver Information

driverquery

It can be very useful when troubleshooting to know what drivers are installed on a system. This command will give you a complete listing of the drivers and when they were installed.


Find Files Opened By Network Users

openfiles /query

If you are running a system and you want to know who has files open on your computer, this command will provide you a list of those users and the files that they have open.

Note: If you get an error saying The system global flag ‘maintain objects list’ needs to be enabled to see local opened files, you can fix this issue by typing openfiles /local on. You will have to reboot the system but it will resolve the issue.


Monitor Port Activity

netstat -a 30

This will show you all of the TCP/IP ports that are being used on your system and what they are connecting to (or being connected from). It will continue to monitor these ports and refresh the information every 30 seconds. You can change the refresh rate by changing the number at the end of the command.


Recover Information From A Corrupt File

recover filename.ext

If you have a disk with damaged sectors, you can attempt to recover as much information as possible from the damaged file. Data that is not damaged can be retrieved but data in damaged sectors will be lost.


Defragment Remote Computer

rexec remotePC defrag C: /F

This command used the rexec command to force a defragment of the C: drive on the computer named remotePC. You can use whatever you want to for the command (I just used defrag C: /F as an example). This is very useful for remote maintenance.


Retrieve Detailed System Information

systeminfo

With this command, you can retrieve the following information:

* Host Name
* OS Name
* OS Version
* OS Manufacturer
* OS Configuration
* OS Build Type
* Registered Owner
* Registered Organization
* Product ID
* Original Install Date
* System Up Time
* System Manufacturer
* System Model
* System type
* Processor(s)
* BIOS Version
* Windows Directory
* System Directory
* Boot Device
* System Locale
* Input Locale
* Time Zone
* Total Physical Memory
* Available Physical Memory
* Virtual Memory Max Size
* Virtual Memory Available
* Virtual Memory In Use
* Page File Location(s)
* Domain
* Logon Server
* Hotfix(s)
* NetWork Card(s)


Schedule Defrag to Defragment C: Daily

schtasks /create /tn “Defrag C” /tr “defrag c: /f” /sc daily /st 02:00:00 /ru “System”

This will set your computer to automatically perform a complete defrag of the C: drive each day at 11:00:00 PM (23:00:00). It does this by creating a scheduled task called Defrag C. It will run this command under the computer’s system account.


Map A Drive Letter to a Folder

subst W: C:windows

Sometimes, your directory structure can get pretty deep and complicated. You can simplify this a bit by mapping a drive letter to commonly used folders. In the example that I have given, this will create a drive letter W: and map it to the C:windows directory. Then, whenever you go into My Computer, you will see a W: drive and when you browse to it, it will automatically take you to the contents of the C:windows folder.

You can do this with any unused drive letter and any folder that exists on your system.


List All Tasks Running On The Computer

tasklist

It’s always good to know what is running on your system. This is the command line version of the processes tab in Taks Manager.


Kill A Program

taskkill /im programname.exe /f

If, when using the tasklist command, you discover that there is something running you just want killed. This is the way to do it! Just note the program name and use it in place of programname.exe.


Reboot a Remote Computer

shutdown -r -f -m \remotePC -c “System will be rebooted in 30 seconds”

Sometimes, you just need to reboot a system. This will do it remotely and give the user a 30 second warning.


Schedule computer reboot

schtasks /create /tn “Reboot” /tr “shutdown /r /t 1” /sc once /st 01:00:00 /sd 08/18/2009 /ru “System”


cmd /c – Carries out the command specified by string and then terminates
&& – concatenates commands together

This way you can create a shortcut for short scripts without creating batch files.
e.g. a shortcut for stopping and starting the print spooler.

%windir%System32cmd.exe /c “net.exe stop Spooler && net start Spooler”


Sleep
No sleep command in Windows 2000/XP (AFAIK) unless you have the Resource Kit, and then you have to move extra files around with your scripts.
Simply use the ping command to wait predefined times. In this example it’s 10 seconds.

ping -n 10 127.0.0.1 > NUL 2>&1


Find
Windows answer to grep. Not as powerful but still useful.

e.g. In conjunction with systeminfo above to find out the Virtual Memory on the PC.

systeminfo find “Virtual Memory”

Categories
CLI Command Line Grep Linux Win 7 Win7 Windows Windows 2000 Windows 2003 Windows 7 Windows Vista Windows7

Windows (XP, Vista, Windows 7, 2003, 2008) Commands

Here is a great list Windows XP/2000 commands that will make any Linux user feel at home at the command prompt. A lot of these commands are intended for administrating a network, but they are great for savvy home users as well.

  • at – Windows Scheduling utility
  • bootcfg – This utility allows you to set up your boot options, such as your default OS and other loading options
  • cacls – Changes the ACLs (security Settings) of files and folders. Very similar to chmod in Linux.
  • comp – This utility is very similar to diff in Linux. Use the /? switch to get examples of command usage.
  • defrag – Yes, XP comes with a command line disk defrag utility. Here’s an example of how to create a scheduled task to defrag every day:

    schtasks /create /tn “Defrag C” /tr “defrag c: /f” /sc daily /st 04:30:00 /ru “System”

  • diskpart – Use this command to manage your disk partitions. This is the text version for the GUI Disk Manager.
  • driverquery – Produces a list of drivers, their properties, and their versions. Great for computer documentation.
  • eudcedit (unpublished) – Private Character editor. Yes with this program built into Windows XP you can create your own font!
  • findstr – Find String – similar to Linux’s Grep.
  • fsutil (unpublished) – This is a utility with a lot of capability. Come back soon for great examples.
  • getmac – This command gets the Media Access Control (MAC) address of your network cards.
  • gpresult – This generates a summary of the user settings and computer group policy settings.
  • gpupdate – Use this utility to manually apply computer and user policy from your windows 2000 (or newer) Active Directory domain.
  • ipconfig – This handy tool displays IP settings of the current computer and much more.
  • MMC – Microsoft Management Console. This is the master tool for Windows, it is the main interface in which all other tools use starting primarily in Windows 2000 and newer systems.
  • more- Utility used to display text output one screen at a time. Example:

    more c:windowswin.ini

  • msconfig – The ultimate tool to change the services and utilities that start when your Windows machine boots up. You can also copy the executable from XP and use it in Win2k.
  • msinfo32 – An awesome diagnostic tool. With it you can get a list of running processes, including the residing path of the executable (great for manually removing malware) and get detailed information about hardware and system diagnostics.
  • narrator – Turns on the system narrator (can also be found in accessibility options in control panel). Will will allow your computer to dictate text to you.
  • netsh – A network configuration tool console. At the ‘netsh>’ prompt, use the ‘?’ to list the available commands and type “exit” to get back to a command prompt.
  • netstat – A local network port tool – try netstat -ano.
  • nslookup – A DNS name resolution tool.
  • openfiles – Allows an administrator to display or disconnect open files in XP professional. Type “openfiles /?” for a list of possible parameters.
  • Pathping – A cross between the ping and traceroute utilities. Who needs Neotrace when you can use this? Type “pathping ” and watch it go.
  • recover – This command can recover readable information from a damaged disk and is very easy to use.
  • reg – A console registry tool, great for scripting Registry edits.
  • sc – A command line utility called the Service Controller. A power tool to make service changes via a logon/logoff or startup/shutdown script.
  • schtasks – A newer version of the AT command. This allows an administrator to schedule and manage scheduled tasks on a local and remote machines.
  • secedit – Use this utility to manually apply computer and user policy from your windows 2000 (or newer) domain. Example to update the machine policy: secedit /refreshpolicy machine_policy /enforce
    To view help on this, just type secedit.
    NOTE: In Windows XP SP1 and news, this command is superceded by: gpupdate /force
  • sfc – The system file checker scans important system files and replaces the ones you (or your applications) hacked beyond repair with the real, official Microsoft versions.
  • shutdown – With this tool, You can shut down or restart your own computer, or an administrator can shut down or restart a remote computer.
  • sigverif – With the sigverif tool you can have all driver files analyzed to verify that they are digitally signed. Just type ‘sigverif’ at the command prompt.
  • systeminfo – Basic system configuration information, such as the system type, the processor type, time zone, virtual memory settings, system uptime, and much more. This program is great for creating an inventory of computers on your network.
  • sysedit – System Configuration File Editor. An old tool that was very handy for the Windows 9X days. msconfig is what you want to use now.
  • tasklist – Tasklist is the command console equivalent to the task manager in windows. It is a must have when fighting malware and viruses. Try the command:

    tasklist /svc to view the memory resources your services take up.

  • taskkill – Taskkill contains the rest of the task manager functionality. It allows you to kill those unneeded or locked up applications.
  • tree – This command will provide a ‘family tree’ style display of the drive/folder you specify.
  • WMIC – Windows Management Instrumentation Command tool. This allows you to pull an amazing amount of low-level system information from a command line scripting interface.

Of course this list in note exhaustive, I just wanted to focus on tools that are particularly helpful that everyone might use. For the official list, please visit Microsoft Windows XP Pro Command Reference.

Categories
CLI Command Line Linux Passwords Windows

How to Change User Password at Command Prompt

To change a user’s password at the command prompt, log on as an administrator and type:

net user user_name * /domain

When you are prompted to type a password for the user, type the new password, not the existing password. After you type the new password, the system prompts you to retype the password to confirm. The password is now changed.

Alternatively, you can type the following command:

net user user_name new_password

When you do so, the password changes without prompting you again. This command also enables you to change passwords in a batch file.

Non-administrators receive a “System error 5 has occurred. Access is denied” error message when they attempt to change the password.

Reference: MS KB 149427

Categories
CLI Command Line Linux PowerShell Reference SQL Windows

Command line reference: Database and Operating Systems.

Great resource for Windows and Linux command line utilities as well as SQL, Oracle and Windows PowerShell.

http://ss64.com/index.html

Categories
Command Line Linux Security

Linux / UNIX: Restrict Access To A Given Command

How do I restrict access to a given command for instance /opt/apps/start, to authorized users only under Linux / UNIX / BSD operating system?

You need to use traditional Unix groups concept to enhance security including restricted access to a given command.

Step # 1: Create and Maintain a Group For All Authorized Users

Create a group named appsonly:
# groupadd appsonly

Add all authorized users to appsonly:
# usermod -aG {groupName} {userName}
# usermod -aG appsonly tom
# usermod -aG appsonly jerry
# id jerry

Where,

  1. -a : Add the user to the supplemental group(s) i.e. appends the user to the current supplementary group list.
  2. -G : A list of supplementary groups which the user is also a member of.

Step #2: Restrict Access

Now a group of user had been created. Next, use the chgrp command to change the group of /opt/apps/start to appsonly group:
# chgrp {groupName} {/path/to/command}
# chgrp appsonly /opt/apps/start

Disable the file permission for others

Finally, use the chmod command to change file permission as follows:
# chmod 750 /path/to/command
# chmod 750 /opt/apps/start

You can also apply permissions to directory (this will disable ls command access to others) :
# chgrp appsonly /opt/apps
# chmod 0640 /opt/apps

Step # 3: Test It

su to tom, enter:
# su - tom
$ id
$ /opt/apps/start
$ exit

su to vivek (not a member of appsonly group), enter:
# su - vivek
$ id
$ /opt/apps/start

Sample outputs:

bash: /opt/apps/start: Permission denied

A Note About ACL and SELinux

The access control policies which can be enforced by chmod, chgrp, and usermod commands are limited, and configuring SELinux and fille system ACLs (access control list) is a better and recommend option for large deployments.

Categories
Command Line utilities Windows 7

Windows 7 Command Line Utilities and Commands

The following is a (hopefully) comprehensive list of command line commands and utilities for Windows 7. Click the links for further details and examples of each command.

arp

The arp command is used to display or change entries in the ARP cache.

assoc

The assoc command is used to display or change the file type associated with a particular file extension.

at

The at command is used to schedule commands and other programs to run at a specific date and time.

attrib

The attrib command is used to change the attributes of a single file or a directory.

auditpol

The auditpol command is used to display or change audit policies.

bcdedit

The bcdedit command is used to view or make changes to Boot Configuration Data.

bitsadmin

The bitsadmin command is used to create, manage, and monitor download and upload jobs.

bootcfg

The bootcfg command is used to build, modify, or view the contents of the boot.ini file, a hidden file that is used to identify in what folder, on which partition, and on which hard drive Windows is located.

break

The break command sets or clears extended CTRL+C checking on DOS systems.

cacls

The cacls command is used to display or change access control lists of files.

call

The call command is used to run a script or batch program from within another script or batch program.

certreq

The certreq command is used to perform various certification authority (CA) certificate functions.

certutil

The certutil command is used to dump and display certification authority (CA) configuration information in addition to other CA functions.

change

The change command changes various terminal server settings like install modes, COM port mappings, and logons.

chcp

The chcp command displays or configures the active code page number.

chdir

The chdir command is used to display the drive letter and folder that you are currently in. Chdir can also be used to change the drive and/or directory that you want to work in.

chglogon

The chglogon command enables, disables, or drains terminal server session logins.

chgport

The chgport command can be used to display or change COM port mappings for DOS compatibility.

chgusr

The chgusr command is used to change the install mode for the terminal server.

chkdsk

The chkdsk command, often referred to as check disk, is used to identify and correct certain hard drive errors.

chkntfs

The chkntfs command is used to configure or display the checking of the disk drive during the Windows boot process.

choice

The choice command is used within a script or batch program to provide a list of choices and return of the value of that choice to the program.

cipher

The cipher command shows or changes the encryption status of files and folders on NTFS partitions.

clip

The clip command is used to redirect the output from any command to the clipboard in Windows.

cls

The cls command clears the screen of all previously entered commands and other text.

cmd

The cmd command starts a new instance of the command interpreter.

cmdkey

The cmdkey command is used to show, create, and remove stored user names and passwords.

cmstp

The cmstp command installs or uninstalls a Connection Manager service profile.

color

The color command is used to change the colors of the text and background within the Command Prompt window.

comp

The comp command is used to compare the contents of two files or sets of files.

compact

The compact command is used to show or change the compression state of files and directories on NTFS partitions.

convert

The convert command is used to convert FAT or FAT32 formatted volumes to the NTFS format.

copy

The copy command does simply that – it copies one or more files from one location to another.

date

The date command is used to show or change the current date.

debug

The debug command starts Debug, a command line application used to test and edit programs.

defrag

The defrag command is used to defragment a drive you specify. The defrag command is the command line version of Microsoft’s Disk Defragmenter.

del

The del command is used to delete one or more files. The del command is the same as the erase command.

dir

The dir command is used to display a list of files and folders contained inside the folder that you are currently working in. The dir command also displays other important information like the hard drive’s serial number, the total number of files listed, their combined size, the total amount of free space left on the drive, and more.

diskcomp

The diskcomp command is used to compare the contents of two floppy disks.

diskcopy

The diskcopy command is used to copy the entire contents of one floppy disk to another.

diskpart

The diskpart command is used to create, manage, and delete hard drive partitions.

diskraid

The diskraid command starts the DiskRAID tool which is used to manage and configure RAID arrays.

dism

The dism command starts the Deployment Image Servicing and Management tool (DISM). The DISM tool is used to manage features in Windows images.

dispdiag

The dispdiag command is used to output a log of information about the display system.

doskey

The doskey command is used to edit command lines, create macros, and recall previously entered commands.

driverquery

The driverquery command is used to show a list of all installed drivers.

echo

The echo command is used to show messages, most commonly from within script or batch files. The echo command can also be used to turn the echoing feature on or off.

edit

The edit command starts the MS-DOS Editor tool which is used to create and modify text files.

edlin

The edlin command starts the Edlin tool which is used to create and modify text files from the command line.

endlocal

The endlocal command is used to end the localization of environment changes inside a batch or script file.

erase

The erase command is used to delete one or more files. The erase command is the same as the del command.

eventcreate

The eventcreate command is used to create a custom event in an event log.

exe2Bin

The exe2bin command is used to convert a file of the EXE file type (executable file) to a binary file.

exit

The exit command is used to end the Command Prompt session that you’re currently working in.

expand

The expand command is used to extract a single file or a group of files from a compressed file.

fastopen

The fastopen command is used to add a program’s hard drive location to a special list stored in memory, potentially improving the program’s launch time by removing the need for MS-DOS to locate the application on the drive.

fc

The fc command is used to compare two individual or sets of files and then show the differences between them.

find

The find command is used to search for a specified text string in one or more files.

findstr

The findstr command is used to find text string patterns in one or more files.

finger

The finger command is used to return information about one or more users on a remote computer that’s running the Finger service.

for

The for command is used to run a specified command for each file in a set of files. The for command is most often used within a batch or script file.

forfiles

The forfiles command selects one or more files to execute a specified command on. The forfiles command is most often used within a batch or script file.

format

The format command is used to format a drive in the file system that you specify.

fsutil

The fsutil command is used to perform various FAT and NTFS file system tasks like managing reparse points and sparse files, dismounting a volume, and extending a volume.

ftp

The ftp command can used to transfer files to and from another computer. The remote computer must be operating as an FTP server.

ftype

The ftype command is used to define a default program to open a specified file type.

getmac

The getmac command is used to display the media access control (MAC) address of all the network controllers on a system.

goto

The goto command is used in a batch or script file to direct the command process to a labeled line in the script.

gpresult

The gpresult command is used to display Group Policy settings.

gpupdate

The gpupdate command is used to update Group Policy settings.

graftabl

The graftabl command is used to enable the ability of Windows to display an extended character set in graphics mode.

graphics

The graphics command is used to load a program that can print graphics.

help

The help command provides more detailed information on any of the other Command Prompt commands.

hostname

The hostname command displays the name of the current host.

icacls

The icacls command is used to display or change access control lists of files. The icacls command is an updated version of the cacls command.

if

The if command is used to perform conditional functions in a batch file.

ipconfig

The ipconfig command is used to display detailed IP information for each network adapter utilizing TCP/IP. The ipconfig command can also be used to release and renew IP addresses on systems configured to receive them via a DHCP server.

irftp

The irftp command is used to transmit files over an infrared link.

iscsicli

The iscsicli command starts the Microsoft iSCSI Initiator, used to manage iSCSI.

label

The label command is used to manage the volume label of a disk.

loadfix

The loadfix command is used to load the specified program in the first 64K of memory and then runs the program.

lodctr

The lodctr command is used to update registry values related to performance counters.

logman

The logman command is used to create and manage Event Trace Session and Performance logs. The logman command also supports many functions of Performance Monitor.

logoff

The logoff command is used to terminate a session.

mem

The mem command shows information about used and free memory areas and programs that are currently loaded into memory in the MS-DOS subsystem.

mkdir (md)

The mkdir command is used to create a new folder.

mklink

The mklink command is used to create a symbolic link.

mmc

The mmc command can be used to open Microsoft Management Console in author mode or to a specific snap-in console, all from the Command Prompt.

mode

The mode command is used to configure system devices, most often COM and LPT ports.

more

The more command is used to display the information contained in a text file. The more command can also be used to paginate the results of any other Command Prompt command.

mountvol

The mountvol command is used to display, create, or remove volume mount points.

move

The move command is used to move one or files from one folder to another. The move command is also used to rename directories.

msg

The msg command is used to send a message to a user.

msiexec

The msiexec command is used to start Windows Installer, a tool used to install and configure software.

mstsc

The mstsc command starts the Remote Desktop Connection tool from the Command Prompt.

muiunattend

The muiunattend command starts the Multilanguage User Interface unattended setup process.

nbtstat

The nbtstat command is used to show TCP/IP information and other statistical information about a remote computer.

net

The net command is used to display, configure, and correct a wide variety of network settings.

netcfg

The netcfg command is used to install the Windows Preinstallation Environment (WinPE), a lightweight version of Windows used to deploy workstations.

netstat

The netstat command is most commonly used to display all open network connections and listening ports.

nlsfunc

The nlsfunc command is used to load information specific to a particular country or region.

nltest

The nltest command is used to test secure channels between Windows computers in a domain and between domain controllers that are trusting other domains.

nslookup

The nslookup is most commonly used to display the hostname of an entered IP address. The nslookup command queries your configured DNS server to discover the IP address.

ocsetup

The ocsetup command starts the Windows Optional Component Setup tool, used to install additional Windows features.

openfiles

The openfiles command is used to display and disconnect open files and folders on a system.

path

The path command is used to display or set a specific path available to executable files.

pathping

The pathping command functions much like the tracert command but will also report information about network latency and loss at each hop.

pause

The pause command is used within a batch or script file to pause the processing of the file. When the pause command is used, a Press any key to continue… message displays in the command window.

ping

The ping command sends an Internet Control Message Protocol (ICMP) Echo Request message to a specified remote computer to verify IP-level connectivity.

pkgmgr

The pkgmgr command is used to start the Windows Package Manager from the Command Prompt. Package Manager installs, uninstalls, configures, and updates features and packages for Windows.

pnpunattend

The pnpunattend command is used to automate the installation of hardware device drivers.

pnputil

The pnputil command is used to start the Microsoft PnP Utility, a tool used to install a Plug and Play device from the command line.

popd

The popd command is used to change the current directory to the one most recently stored by the pushd command. The popd command is most often utilized from within a batch or script file.

print

The print command is used to print a specified text file to a specified printing device.

prompt

The prompt command is used to customize the appearance of the prompt text in Command Prompt.

psr

The Psr command starts Problem Step Recorder, a screen capture and logging program for use in troubleshooting problems.

pushd

The pushd command is used to store a directory for use, most commonly from within a batch or script program.

qappsrv

The qappsrv command is used to display all Remote Desktop Session Host servers available on the network.

qprocess

The qprocess command is used to display information about running processes.

query

The query command is used to display the status of a specified service.

quser

The quser command is used to display information about users currently logged on to the system.

qwinsta

The qwinsta command is used to display information about open Remote Desktop Sessions.

rasdial

The rasdial command is used to start or end a network connection for a Microsoft client.

recover

The recover command is used to recover readable data from a bad or defective disk.

reg

The reg command is used to manage the Windows Registry from the command line. The reg command can perform common registry functions like adding registry keys, exporting the registry, etc.

regsvr32

The regsvr32 command is used to register a DLL file as a command component in the Windows Registry.

relog

The relog command is used to create new performance logs from data in existing performance logs.

rem

The rem command is used to record comments or remarks in a batch or script file.

rename (ren)

The rename command is used to change the name of the individual file that you specify.

replace

The replace command is used to replace one or more files with one or more other files.

reset session (rwinsta)

The reset session command is used to reset the session subsystem software and hardware to known initial values.

rmdir (rd)

The rmdir command is used to delete an existing and completely empty folder.

robocopy

The robocopy command is used to copy files and directories from one location to another. The robocopy command is superior to the more simple copy command because robocopy supports many more options. This command is also called Robust File Copy.

route

The route command is used to manipulate network routing tables.

rpcping

The rpcping command is used to ping a server using RPC.

runas

The runas command is used to execute a program using another user’s credentials.

sc

The sc command is used to configure information about services. The sc command communicates with the Service Control Manager.

schtasks

The schtasks command is used to schedule specified programs or commands to run a certain times. The schtasks command can be used to create, delete, query, change, run, and end scheduled tasks.

secedit

The secedit command is used to configure and analyze system security by comparing the current security configuration to a template.

set

The set command is used to enable or disable certain options in Command Prompt.

setlocal

The setlocal command is used to start the localization of environment changes inside a batch or script file.

setver

The setver command is used to set the MS-DOS version number that MS-DOS reports to a program.

setx

The setx command is used to create or change environment variables in the user environment or the system environment.

sfc

The sfc command is used to verify and replace important Windows system files. The sfc command is also referred to as System File Checker and Windows Resource Checker.

shadow

The shadow command Is used to monitor another Remote Desktop Services session.

share

The share command is used to install file locking and file sharing functions in MS-DOS.

shift

The shift command is used to change the position of replaceable parameters in a batch or script file.

shutdown

The shutdown command can be used to shut down, restart, or log off the current system or a remote computer.

sort

The sort command is used to read data from a specified input, sort that data, and return the results of that sort to the Command Prompt screen, a file, or another output device.

start

The start command is used to open a new command line window to run a specified program or command. The start command can also be used to start an application without creating a new window.

subst

The subst command is used to associate a local path with a drive letter. The subst command is a lot like the net use command except a local path is used instead of a shared network path.

sxstrace

The sxstrace command is used to start the WinSxs Tracing Utility, a programming diagnostic tool.

systeminfo

The systeminfo command is used to display basic Windows configuration information for the local or a remote computer.

takeown

The takedown command is used to regain access to a file that that an administrator was denied access to when reassigning ownership of the file.

taskkill

The taskkill command is used to terminate a running task. The taskkill command is the command line equivalent of ending a process in Task Manager in Windows.

tasklist

“Displays a list of applications, services, and the Process ID (PID) currently running on either a local or a remote computer.

tcmsetup

The tcmsetup command is used to setup or disable the Telephony Application Programming Interface (TAPI) client.

time

The time command is used to show or change the current time.

timeout

The timeout command is typically used in a batch or script file to provide a specified timeout value during a procedure. The timeout command can also be used to ignore keypresses.

title

The title command is used to set the Command Prompt window title.

tracerpt

The tracerpt command is used to process event trace logs or real-time data from instrumented event trace providers.

tracert

The tracert command sends Internet Control Message Protocol (ICMP) Echo Request messages to a specified remote computer with increasing Time to Live (TTL) field values and displays the IP address and hostname, if available, of the router interfaces between the source and destination.

tree

The tree command is used to graphically display the folder structure of a specified drive or path.

tsdiscon

The tsdiscon command is used to disconnect a Remote Desktop session.

tskill

The tskill command is used to end the specified process.

type

The type command is used to display the information contained in a text file.

typeperf

The typerperf command displays performance data in the Command Prompt window or writes the data to specified log file.

tzutil

The tzutil command is used to display or configure the current system’s time zone. The tzutil command can also be used to enable or disable automatic Daylight Saving Time adjustments.

tnlodctr

The unlodctr command removes Explain text and Performance counter names for a service or device driver from the Windows Registry.

ver

The ver command is used to display the current Windows version.

verify

The verify command is used to enable or disable the ability of Command Prompt to verify that files are written correctly to a disk.

vol

The vol command shows the volume label and serial number of a specified disk, assuming this information exists.

vssadmin

The vssadmin command starts the Volume Shadow Copy Service administrative command line tool which displays current volume shadow copy backups and all installed shadow copy writers and providers.

w32Tm

The w32tm command is used to diagnose issues with Windows Time.

waitfor

The waitform command is used to send or wait for a signal on a system.

wbadmin

The wbadmin command is used start and stop backup jobs, display details about a previous backup, list the items within a backup, and report on the status of a currently running backup.

wevtutil

The wevtutil command starts the Windows Events Command Line Utility which is used to manage event logs and publishers.

where

The where command is used to search for files that match a specified pattern.

whoami

The whoami command is used to retrieve user name and group information on a network.

winrm

The winrm command is used to start the command line version of Windows Remote Management, used to manage secure communications with local and remote computers using web services.

winrs

The winrs command is used to open a secure command window with a remote host.

winsat

The winsat command starts the Windows System Assessment Tool, a program that assesses various features, attributes, and capabilities of a computer running Windows.

wmic

The wmic command starts the Windows Management Instrumentation Command line (WMIC), a scripting interface that simplifies the use of Windows Management Instrumentation (WMI) and systems managed via WMI.

xcopy

The xcopy command can copy one or more files or directory trees from one location to another.