Showing posts with label Black Commands. Show all posts
Showing posts with label Black Commands. Show all posts

Saturday, 28 June 2014

Getting Acquainted with Variables in CMD

Getting Acquainted with Variables

In command-line scripting, what we commonly call variables are more properly called environment variables. Environment variables can come from many sources. Some variables are built into the operating system or derived from the system hardware during startup. These variables, called built-in system variables, are available to all Windows processes regardless of whether anyone is logged on interactively. System variables can also come from the Windows Registry. Other variables are set during logon and are called built-in user variables. The built-in user variables available are the same, no matter who is logged on to the computer. As you might expect, they are valid only during an actual logon session, that is, when a user is logged on.

You can see a listing of all the variables known in the current instance of the command shell by typing set at the prompt. In addition to the normal system and user variables, you can create variables whenever Windows is running, which is exactly what you’ll do when you program in the command shell. You define variables for the current instance of the command shell using the SET command and the following syntax:
set variable_name=variable_value
such as
set working=C:\Work\Data
set value=5
set string="Hello World"
Some variables, including system and user environment variables, have special meaning in the command shell. These variables include path, computername, homedrive, and many other important environment variables. One environment variable that you should learn more about is errorlevel, which tracks the exit code of the most recently used command. If the command executes normally, the error level is zero (0). If an error occurs while executing the command, the error level is set to an appropriate nonzero value. Error values include
  • 1  Indicates a general error
  • 2  Indicates an execution error, meaning the command failed to execute properly
  • 2  Indicates a math error, such as when you create a number that is too large for the command shell to handle
You can work with the errorlevel variable in several ways. You can check for a specific error condition, such as
if "%ERRORLEVEL%"=="2" echo "An error occurred!"
Or, you can use the following special syntax and check for a condition equal to or greater than the specified exit code:
if errorlevel 2 echo "An error occurred!"
Note 
You’ll see more on errorlevel and if statements later in the chapter in the section titled “Using Conditional Statements.”
When you are finished working with variables, it’s good form to dispose of them. You do this to free memory used by the variable and prevent problems or unexpected results if you accidentally refer to the variable in the future. To clear out a variable, you simply set the variable equal to nothing, such as
set working=
Now the variable is cleared out of memory and is no longer available.

Using Windows Support Tools

Using Windows Support Tools

The Windows Support Tools are a collection of utilities for handling everything from system diagnostics to network monitoring. These tools can be installed on, and used with, all versions of Windows Server 2003 and Windows XP Professional. You can install the support tools by completing the following steps:
  1. Insert the appropriate operating system CD-ROM (Windows Server 2003 or Windows XP Professional) into the CD-ROM drive.
    Caution 
    Because the Support Tools installation modifies the Help And Support Center, you should close any instances of this console that are running before you start the installation process. If you don’t do this, the installation will fail.
  2. When the Autorun screen appears, click Perform Additional Tasks, and then click Browse This CD. This starts Windows Explorer.
  3. In Windows Explorer, double-click Support and then double-click Tools.
    Note 
    Throughout this book, I refer to double-clicking, which is the most common technique used for accessing folders and for running programs. With a double click, the first click selects the item and the second click opens/runs the item. In both Windows Server 2003 and in Windows XP Professional, you can also configure single-click open/ run. Here, moving the mouse over the item selects it and a single click opens/runs the item. You can change the mouse click options with the Folder Options utility in the Control Panel. To do this, select the General tab, and then choose Single-Click To Open An Item or Double-Click To Open An Item, as desired.
  4. Double-click Suptools.msi. This starts the Windows Support Tools Setup Wizard. Click Next.
  5. Read the End User License Agreement and then, if you agree and want to continue, click I Agree and then click Next.
  6. Enter your user information, and then click Next.
  7. In Windows XP Professional, you then see the Select An Installation Type page. Select Complete and then click Next.
  8. Select the destination directory for the support tools. The default location is %ProgramFiles%\Support Tools. If you don’t want to use the default location, type a new directory path or click Browse to search for a location. In Windows Server 2003, the support tools use about 24 megabytes (MB) of disk space. Selecting the Complete option when installing the Windows XP Professional version of the support tools requires about 12 MB of disk space.
  9. Click Install Now.
  10. Click Finish on the Completing The Windows Support Tools Setup Wizard page.
After installation you can access the support tools through the Help And Support Center(This figure shows the Windows Server 2003 window, though the Windows XP Professional window is very similar.) Click Start, click Programs or All Programs as appropriate, click Windows Support Tools, and then select Support Tools Help. As the figure shows, the tools are organized by file name, tool name, and category. Clicking a tool name accesses a help page that displays the online help documentation for the tool and that you can also use to run the tool.


Use support tools to perform such tasks as system diagnostics and network monitoring.
Most of the support tools have extensions that allow you to run them from the command line. You will find the executables for the support tools in the installation directory, which by default is %SystemDrive%\Program Files\Support Tools.
Because the system path is updated to include the support tools installation directory, you do not need to be in this directory to execute the support tools. You can, in fact, run the tools at any command prompt regardless of the current directory. As with other Windows utilities and commands, you can display the syntax for a particular support tool by typing the command name following by a space and /?, such as spcheck /?.

Wednesday, 11 June 2014

General talk about Commands

Command is a common term for all Operating Systems


                              
Windows => Command Prompt,                   Linux  => SHELL Command.


Generally we think about Command, at first we know "Unix,Linux and similar OS".

General Structure of Operating System: 

But we all should know this before start,
This is a common structure of Operating System. So finally we should accept as "by Known or Unknown we bidirectionally connect with Commands". 

In earlier days our computer Operating Systems are only run by the help of Commands. So It only have a black screen and we using keyboard to give a command to our Operating System, then that transfer the machine level instruction to the Computer Hardware, Finally Computer responds our needs.

But, during this period Computer was not get more famous. But the same time it used by research centres very much for quick calculations. The main reason for lack of publicity is "Very Difficult to Understand". Really its not only a major reason, real one is Size. Earlier Computer occupies more space.

After the evaluation, The size of the Computer get reduced, But the Publicity

Operating System statistics 
1.Windows 7
  
50.06%
2.Windows XP
  
25.27%
3.Windows 8/Windows 8.1
  
12.64%
4.OS X
  
7.38%
5.Other 
  
3.36%
6.Windows Vista
  
2.90%
7.Linux
  
1.62%
Desktop OS Market Share as of May 2014 according to Usage of OS.

The reason for the usage, public says "Operating Systems like Windows are having  good GUI interface, So it's very easy to understand and work in full fledged.". It's a acceptable reason but the Powerful Operations are start with commands

let I Start to teach You all a Great PlatformCommander...!