Wscript. Shell object details !!

Source: Internet
Author: User
Wshshell object
Progid wscript. Shell
File Name wshom. ocx
CLSID F935DC22-1CF0-11d0-ADB9-00C04FD58A0B
IID F935DC21-1CF0-11d0-ADB9-00C04FD58A0B

The following table describes the properties related to the wshshell object.

Attribute description
Environment returns the wshenvironment collection object.
Specialfolders uses the wshspecialfolders object to provide access to Windows Shell Folders, such as desktop folders, Start Menu folders, and personal document folders.

The following table describes the methods related to the wshshell object.

Method description
Createshortcut is created and the wshshortcut object is returned.
Expandenvironmentstrings extends the process environment variables and returns the result string.
Popup displays the message window containing the specified message.
Regdelete deletes the specified key or value from the registry.
Regread returns the specified key or value from the registry.
Regwrite sets the specified key or value in the registry.
Run creates a new process and runs the specified command in the specified window style.

Wshshell. Environment
The environment attribute returns the wshenvironment object.

Syntax
Wshshell. Environment ([strtype]) = ob1_shenvironment

Note
If strtype specifies the location of the environment variable, the values may be "system", "user", "volatile", and "process ". If strtype is not provided, this method retrieves system environment variables in Windows NT or process environment variables in Windows 95.

For Windows 95, the strtype parameter only supports "process ".

The following variables are provided by the Windows operating system. The script can also obtain environment variables set by other applications.

Description
Number_of_processors: Number of processors running on the computer.
Processor_architecture the type of processor used by the user workstation.
Processor_identifier the processor ID of the user workstation.
Processor_level the processor level of the user workstation.
Processor_revision the processor version of the user workstation.
The operating system used by the OS user workstation.
Comspec is the command used to run the "command prompt" window (usually cmd.exe ).
Homedrive local master drive (usually C drive ).
The default path of the homepath user (\ Users \ default is usually used on Windows NT ).
PATH environment variable.
The extension of the pathext executable file (usually. com,. EXE,. bat, or. cmd ).
Prompt command prompt (usually $ p $ g ).
The local drive where the systemdrive system is located (for example, c :\).
Systemroot system directory (for example, c: \ WINNT ). Same as WINDIR.
WINDIR system directory (for example, c: \ WINNT ). Same as systemroot.
Temp stores the directory of temporary files (for example, c: \ Temp ). Users can change the value.
Tmp directory for storing temporary files (for example, c: \ Temp ). Users can change the value.

Example
'Retrieve the number_of_processors system environment variable
Set wshshell = wscript. Createobject ("wscript. Shell ")

Set wshsysenv = wshshell. Environment ("system ")
Wscript. Echo wshsysenv ("number_of_processors ")

See
Wshenvironment object

Wshenvironment object
The wshenvironment object is not provided directly and can be accessed using the wshshell. Environment attribute.

Progid N/
File Name wshom. ocx
CLSID
IID

The following table describes the attributes associated with the wshenvironment object.

Attribute description
Item.
Count refers to the number of enumerated items.
The number of length enumeration items (jscript ).

The following table describes the methods associated with the wshenvironment object.

Method description
Remove deletes the specified environment variable.

Wshshell. specialfolders
The specialfolders property provides the wshspecialfolders object to Access Windows Shell Folders, such as desktop

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.