Windows Script-system variables that can be used in Batch Processing

Source: Internet
Author: User

In fact, the system variables that can be used in batch processing are the environment variables in my computer.
The following is the original text. You can take a rough look at it and have an impression when using it.

As we all know, there are many system variables in batch processing, but we have never heard of them unless we often use them. Let's talk about all the system variables below.
% Allusersprofile % location of the local "all users" configuration file.
% Appdata % local application by default Program The location where the data is stored.
% Cd % local current directory string.
% Cmdcmdline % is used to start the exact command line of the current cmd.exe.
% Cmdextversion % the current "command handler extension" version.
% Computername % name of the computer.
% Comspec % the exact path of the executable program of the command line interpreter.
% Date % current date.
% Errorlevel % error of the previous command Code .
% Homedrive % local workstation drive letter connecting to the user's home directory.
% Homepath % full path of the user's home directory. The main directory can be changed in local users and groups.
% Homeshare % network path of the user's shared home directory.
% Logonserver % verify the name of the domain controller for the current logon session.
% Number_of_processors % specifies the number of processors installed on the computer.
% OS % Operating System name. 2000 and XP display the operating system as windows_nt, and Vista is also.
% PATH % specifies the search path of the executable file.
% Pathext % list of file extensions that the operating system deems executable.
% Processor_architecture % processor chip architecture.
% Processor_identfier % processor description.
% Processor_level % model of the processor installed on the computer.
% Processor_revision % indicates the version number of the processor.
% Prompt % set the command prompt of the current interpreter.
% Random % any decimal number between 0 and 32767, which is unknown till now.
% Systemdrive % is the system root drive letter.
% SystemRoot % = % WINDIR % location of the Windows server operating system root directory (generally C: \ Windows ).
% Temp % and % TMP % default temporary directory used by the system and the user for the applications available to the currently logged-on user.
% Time % current time (exception accurate !).
% Userdomain % contains the domain name of the user account.
% Username % name of the currently logged-on user.
% USERPROFILE % location of the current user's configuration file.

The following is a help file from the set command:

If command extensions are enabled, then there are several dynamic
Environment variables that can be expandedWhich don't show up in
The list of variables displayed by set.
 These variable values are
Computed dynamically each time the value of the variable is expanded.
If the user explicitly defines a variable with one of these names, then
That definition will override the dynamic one described below:

% Cd %-expands to the current directory string.

% Date %-expands to current date using same format as date command.

% Time %-expands to current time using same format as time command.

% Random %-expands to a random decimal number between 0 and 32767.

% Errorlevel %-expands to the current errorlevel Value

% Cmdextversion %-expands to the current command processor extensions
Version number.

% Too many line %-expands to the original command line that invoked
Command processor.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.