Check for running Windows Vista andLAN chatThe computer boot configuration file can usually solve boot-related problems for users and provide a lot of valuable information. Information such as boot partitions, boot directories, and Windows directories is often useful for troubleshooting. In most cases, it takes a lot of time to obtain such information through the vbs script.
LAN chat -www.freeeim.com
If Windows Vista and Windows Server 2008 cannot be started properly, you can check whether the boot configuration file is incorrect. You can also check the startup service and its dependency. Some services in Windows depend on the loading sequence of other services, system drivers, and components. If the system component is stopped or is not running properly, its services will be affected.
Create a script named "displaybootconfig. PS1" to read the boot configuration. The Code is as follows:
Param ($ computer = "localhost", [Switch] $ help)
Function funhelp ()
{
$ Helptext = @"
Description:
Name: displaybootconfig. PS1
Displays a boot up configuration of a Windows system
Parameters:
-Computer the name of the computer
-Help prints Help File
Syntax:
Displaybootconfig. PS1-computer Webserver
Displays boot up configuration of a computer named Webserver
Displaybootconfig. PS1
Displays boot up configuration on Local Computer
Displaybootconfig. PS1-help
Displays the help topic for the script
"@
$ Helptext
Exit
}
If ($ help) {"obtaining help..."; funhelp}
$ WMI = Get-wmiobject-class win32_bootconfiguration'
-Computername $ computer
Format-list-inputobject $ WMI [A-Z] *
The script uses the param statement to define the $ computer and $ help variables. The default value of the former is localhost. Set the-HELP parameter to switch, that is, no additional information is required when you use this parameter, and use the get-wmiobject cmdlet to retrieve information from the win32_bootconfiguration WMI class. If necessary, you can provide the value in the $ computer variable to the-computername parameter. In this way, you can use the get-wmiobject cmdlet to connect to a remote computer and finally pass the returned management object to the format-list cmdlet. Use range operator [A-Z] * to select attributes starting with a character to filter all system attributes in the report (because system attributes start with a line below ).
The execution result of this script is 1.
Read more: Windows Troubleshooting powershell2.0 (a) Startup troubleshooting-tianxingjian @ Chinese elements-blog Park http://www.cnblogs.com/fuhj02/archive/2011/01/16/1937007.html#ixzz1BDVc3100