Pumpkin 🎃 Font

/* * === LIST OF FONTS === * * – Droid Sans Mono ( https://www.fontsquirrel.com/fonts/droid-sans-mono ) * – Ubuntu Mono ( https://www.fontsquirrel.com/fonts/ubuntu-mono ) * – NotCourrier ( https://www.fontsquirrel.com/fonts/notcouriersans ) * – Cousine ( https://www.fontsquirrel.com/fonts/cousine ) * – TeXGyreCursor ( http://www.fontspace.com/gust-e-foundry/texgyrecursor ) * – PTMono ( https://www.fontsquirrel.com/fonts/pt-mono ) */ @font-face { font-family: ‘DroidSansMono’; src: url(‘DroidSansMono.ttf’) format(‘truetype’); } @font-face { font-family: ‘UbuntuMono’; src: url(‘UbuntuMono-R.ttf’) format(‘truetype’); } @font-face { font-family: ‘NotCourier’; src: url(‘NotCourierSans.ttf’) format(‘truetype’); } @font-face { font-family: ‘TeXGyreCursor’; src: url(‘texgyrecursor-regular.otf’) format(‘truetype’); } @font-face { font-family: ‘Cousine’; src: url(‘Cousine-Regular.ttf’) format(‘truetype’); } @font-face { font-family: ‘PTMono’; src: url(‘PTM55FT.ttf’) format(‘truetype’); } /*! Author: Quique Fdez Guerra Twitter: @CKGrafico Microsoft Guidelines: https://msdn.microsoft.com/en-us/library/windows/apps/jj841126.aspx GitHub: https://github.com/CKGrafico/Segoe-mdl2-assets-css */ [class^=”mdl2-“], [class*=”mdl2-“] { font-family: ‘Segoe MDL2 Assets’; } [class^=”mdl2-“]::before, [class*=”mdl2-“]::before { font-size: 1.2pc; color: white; } .mdl2-heart-legacy::before { content: ‘\e006’; } .mdl2-heart-fill-legacy::before { content: ‘\e0a5’; } .mdl2-heart-broken-legacy::before { content: ‘\e007’; } .mdl2-heart-fill-zero-width-legacy::before { content: ‘\e00b’; } .mdl2-heart-broken-zero-width-legacy::before { content: ‘\e00c’; } .mdl2-rating-star-legacy::before { content: ‘\e224’; } .mdl2-rating-star-fill-legacy::before { content: ‘\e0b4’; } .mdl2-rating-star-fill-zero-width-legacy::before { content: ‘\e00a’; } .mdl2-rating-star-fill-reduced-padding-HTML-legacy::before { content: ‘\e082’; } .mdl2-rating-star-fill-small-legacy::before { content: ‘\e0b5’; } .mdl2-half-star-left::before { content: ‘\e7c6’; } .mdl2-half-star-right::before { content: ‘\e7c7’; } .mdl2-check-mark-legacy::before { content: ‘\e001’; } .mdl2-checkbox-fill-legacy::before { content: ‘\e002’; } .mdl2-checkbox-legacy::before { content: ‘\e003’; } .mdl2-checkbox-indeterminate-legacy::before { content: ‘\e004’; } .mdl2-checkbox-composite-reversed-legacy::before { content: ‘\e005’; } .mdl2-check-mark-zero-width-legacy::before { content: ‘\e008’; } .mdl2-checkbox-fill-zero-width-legacy::before { content: ‘\e009’; } .mdl2-checkbox-composite-legacy::before { content: ‘\e0a2’; } .mdl2-checkbox::before { content: ‘\e739’; } .mdl2-checkbox-composite::before { content: ‘\e73a’; } .mdl2-checkbox-fill::before { content: ‘\e73b’; } .mdl2-checkbox-indeterminate::before { content: ‘\e73c’; } .mdl2-checkbox-composite-reversed::before { content: ‘\e73d’; } .mdl2-check-mark::before { content: ‘\e73e’; } .mdl2-comment-legacy::before { content: ‘\e134’; } .mdl2-favorite-legacy::before { content: ‘\e113’; } .mdl2-unfavorite-legacy::before { content: ‘\e195’; } .mdl2-favorite-star::before { content: ‘\e734’; } .mdl2-favorite-star-fill::before { content: ‘\e735’; } .mdl2-unfavorite::before { content: ‘\e8d9’; } .mdl2-like-legacy::before { content: ‘\e19f’; } .mdl2-dislike-legacy::before { content: ‘\e19e’; } .mdl2-like-dislike-legacy::before { content: ‘\e19d’; } .mdl2-video-legacy::before { content: ‘\e116’; } .mdl2-video::before { content: ‘\e714’; } .mdl2-mail-message-legacy::before { content: ‘\e20b’; } .mdl2-reply-legacy::before { content: ‘\e248’; } .mdl2-favorite-2-legacy::before { content: ‘\e249’; } .mdl2-unfavorite-2-legacy::before { content: ‘\e24e’; } .mdl2-mobile-contact-legacy::before { content: ‘\e25a’; } .mdl2-blocked-legacy::before { content: ‘\e25b’; } .mdl2-typing-indicator-legacy::before { content: ‘\e25c’; } .mdl2-presence-chicklet-video-legacy::before { content: ‘\e25d’; } .mdl2-presence-chicklet-legacy::before { content: ‘\e25e’; } .mdl2-scroll-chevron-left-legacy::before { content: ‘\e00e’; } .mdl2-scroll-chevron-right-legacy::before { content: ‘\e00f’; } .mdl2-scroll-chevron-up-legacy::before { content: ‘\e010’; } .mdl2-scroll-chevron-down-legacy::before { content: ‘\e011’; } .mdl2-scroll-chevron-left-bold-legacy::before { content: ‘\e016’; } .mdl2-scroll-chevron-right-bold-legacy::before { content: ‘\e017’; } .mdl2-scroll-chevron-up-bold-legacy::before { content: ‘\e018’; } .mdl2-scroll-chevron-down-bold-legacy::before { content: ‘\e019’; } .mdl2-back-bttn-arrow-2-0-legacy::before { content: ‘\e0c4’; } .mdl2-back-bttn-arrow-4-2-legacy::before { content: ‘\e0a6’; } .mdl2-back-bttn-mirrored-arrow-2-0-legacy::before { content: ‘\e0ad’; } .mdl2-back-bttn-mirrored-arrow-4-2-legacy::before { content: ‘\e0ab’; } .mdl2-chrome-back::before { content: ‘\e830’; } .mdl2-chrome-back-mirrored::before { content: ‘\ea47’; } .mdl2-arrow-HTML-legacy::before { content: ‘\e0d5’; } .mdl2-arrow-HTML-mirrored-legacy::before { content: ‘\e0ae’; } .mdl2-accept::before { content: ‘\e8fb’; } .mdl2-accounts::before { content: ‘\e910’; } .mdl2-add::before { content: ‘\e710’; } .mdl2-add-friend::before { content: ‘\e8fa’; } .mdl2-admin::before { content: ‘\e7ef’; } .mdl2-align-center::before { content: ‘\e8e3’; } .mdl2-align-left::before { content: ‘\e8e4’; } .mdl2-alignright::before { content: ‘\e8e2’; } .mdl2-all-apps::before { content: ‘\e71d’; } .mdl2-attach::before { content: ‘\e723’; } .mdl2-attach-camera::before { content: ‘\e8a2’; } .mdl2-audio::before { content: ‘\e8d6’; } .mdl2-back::before { content: ‘\e72b’; } .mdl2-back-to-window::before { content: ‘\e73f’; } .mdl2-block-contact::before { content: ‘\e8f8’; } .mdl2-bold::before { content: ‘\e8dd’; } .mdl2-bookmarks::before { content: ‘\e8a4’; } .mdl2-browse-photos::before { content: ‘\e7c5’; } .mdl2-bulleted-list::before { content: ‘\e8fd’; } .mdl2-calculator::before { content: ‘\e8ef’; } .mdl2-calendar::before { content: ‘\e787’; } .mdl2-calendar-day::before { content: ‘\e8bf’; } .mdl2-calendar-reply::before { content: ‘\e8f5’; } .mdl2-calendar-week::before { content: ‘\e8c0’; } .mdl2-camera::before { content: ‘\e722’; } .mdl2-cancel::before { content: ‘\e711’; } .mdl2-caption::before { content: ‘\e8ba’; } .mdl2-c-c::before { content: ‘\e7f0’; } .mdl2-cellphone::before { content: ‘\e8ea’; } .mdl2-characters::before { content: ‘\e8c1’; } .mdl2-clear::before { content: ‘\e894’; } .mdl2-clear-selection::before { content: ‘\e8e6’; } .mdl2-close-pane::before { content: ‘\e89f’; } .mdl2-cloud::before { content: ‘\e753’; } .mdl2-comment::before { content: ‘\e90a’; } .mdl2-contact::before { content: ‘\e77b’; } .mdl2-contact-2::before { content: ‘\e8d4’; } .mdl2-contact-info::before { content: ‘\e779’; } .mdl2-contact-presence::before { content: ‘\e8cf’; } .mdl2-copy::before { content: ‘\e8c8’; } .mdl2-crop::before { content: ‘\e7a8’; } .mdl2-cut::before { content: ‘\e8c6’; } .mdl2-delete::before { content: ‘\e74d’; } .mdl2-directions::before { content: ‘\e8f0’; } .mdl2-disable-updates::before { content: ‘\e8d8’; } .mdl2-disconnect-drive::before { content: ‘\e8cd’; } .mdl2-dislike::before { content: ‘\e8e0’; } .mdl2-dock-bottom::before { content: ‘\e90e’; } .mdl2-dock-left::before { content: ‘\e90c’; } .mdl2-dock-right::before { content: ‘\e90d’; } .mdl2-document::before { content: ‘\e8a5’; } .mdl2-download::before { content: ‘\e896’; } .mdl2-edit::before { content: ‘\e70f’; } .mdl2-emoji::before { content: ‘\e899’; } .mdl2-emoji-2::before { content: ‘\e76e’; } .mdl2-favorite-list::before { content: ‘\e728’; } .mdl2-favorite-star::before { content: ‘\e734’; } .mdl2-favorite-star-fill::before { content: ‘\e735’; } .mdl2-filter::before { content: ‘\e71c’; } .mdl2-find-legacy::before { content: ‘\e11a’; } .mdl2-flag::before { content: ‘\e7c1’; } .mdl2-folder::before { content: ‘\e8b7’; } .mdl2-font::before { content: ‘\e8d2’; } .mdl2-fontcolor::before { content: ‘\e8d3’; } .mdl2-font-decrease::before { content: ‘\e8e7’; } .mdl2-font-increase::before { content: ‘\e8e8’; } .mdl2-font-size::before { content: ‘\e8e9’; } .mdl2-forward::before { content: ‘\e72a’; } .mdl2-four-bars::before { content: ‘\e908’; } .mdl2-full-screen::before { content: ‘\e740’; } .mdl2-globe::before { content: ‘\e774’; } .mdl2-go::before { content: ‘\e8ad’; } .mdl2-go-to-start::before { content: ‘\e8fc’; } .mdl2-go-to-today::before { content: ‘\e8d1’; } .mdl2-hangup::before { content: ‘\e778’; } .mdl2-help::before { content: ‘\e897’; } .mdl2-hide-BCC::before { content: ‘\e8c5’; } .mdl2-highlight::before { content: ‘\e7e6’; } .mdl2-home::before { content: ‘\e80f’; } .mdl2-import::before { content: ‘\e8b5’; } .mdl2-import-all::before { content: ‘\e8b6’; } .mdl2-important::before { content: ‘\e8c9’; } .mdl2-italic::before { content: ‘\e8db’; } .mdl2-keyboard-classic::before { content: ‘\e765’; } .mdl2-leave-chat::before { content: ‘\e89b’; } .mdl2-library::before { content: ‘\e8f1’; } .mdl2-like::before { content: ‘\e8e1’; } .mdl2-like-dislike::before { content: ‘\e8df’; } .mdl2-link::before { content: ‘\e71b’; } .mdl2-list::before { content: ‘\ea37’; } .mdl2-location::before { content: ‘\e81d’; } .mdl2-mail::before { content: ‘\e715’; } .mdl2-mail-fill::before { content: ‘\e8a8’; } .mdl2-mail-forward::before { content: ‘\e89c’; } .mdl2-mail-reply::before { content: ‘\e8ca’; } .mdl2-mail-reply-all::before { content: ‘\e8c2’; } .mdl2-manage::before { content: ‘\e912’; } .mdl2-map-drive::before { content: ‘\e8ce’; } .mdl2-mappin::before { content: ‘\e707’; } .mdl2-memo::before { content: ‘\e77c’; } .mdl2-message::before { content: ‘\e8bd’; } .mdl2-microphone::before { content: ‘\e720’; } .mdl2-more::before { content: ‘\e712’; } .mdl2-move-to-folder::before { content: ‘\e8de’; } .mdl2-music-info::before { content: ‘\e90b’; } .mdl2-mute::before { content: ‘\e74f’; } .mdl2-new-folder::before { content: ‘\e8f4’; } .mdl2-new-window::before { content: ‘\e78b’; } .mdl2-next::before { content: ‘\e893’; } .mdl2-one-bar::before { content: ‘\e905’; } .mdl2-open-file::before { content: ‘\e8e5’; } .mdl2-open-local::before { content: ‘\e8da’; } .mdl2-open-pane::before { content: ‘\e8a0’; } .mdl2-open-with::before { content: ‘\e7ac’; } .mdl2-orientation::before { content: ‘\e8b4’; } .mdl2-other-user::before { content: ‘\e7ee’; } .mdl2-outline-star-legacy::before { content: ‘\e1ce’; } .mdl2-page::before { content: ‘\e7c3’; } .mdl2-paste::before { content: ‘\e77f’; } .mdl2-pause::before { content: ‘\e769’; } .mdl2-people::before { content: ‘\e716’; } .mdl2-permissions::before { content: ‘\e8d7’; } .mdl2-phone::before { content: ‘\e717’; } .mdl2-phone-book::before { content: ‘\e780’; } .mdl2-pin::before { content: ‘\e718’; } .mdl2-play::before { content: ‘\e768’; } .mdl2-post-update::before { content: ‘\e8f3’; } .mdl2-preview::before { content: ‘\e8ff’; } .mdl2-preview-link::before { content: ‘\e8a1’; } .mdl2-previous::before { content: ‘\e892’; } .mdl2-priority::before { content: ‘\e8d0’; } .mdl2-protected-document::before { content: ‘\e8a6’; } .mdl2-read::before { content: ‘\e8c3’; } .mdl2-redo::before { content: ‘\e7a6’; } .mdl2-refresh::before { content: ‘\e72c’; } .mdl2-remote::before { content: ‘\e8af’; } .mdl2-remove::before { content: ‘\e738’; } .mdl2-rename::before { content: ‘\e8ac’; } .mdl2-repair::before { content: ‘\e90f’; } .mdl2-repeat-all::before { content: ‘\e8ee’; } .mdl2-repeat-one::before { content: ‘\e8ed’; } .mdl2-report-hacked::before { content: ‘\e730’; } .mdl2-reshare::before { content: ‘\e8eb’; } .mdl2-rotate::before { content: ‘\e7ad’; } .mdl2-rotate-camera::before { content: ‘\e89e’; } .mdl2-save::before { content: ‘\e74e’; } .mdl2-save-local::before { content: ‘\e78c’; } .mdl2-scan::before { content: ‘\e8fe’; } .mdl2-select-all::before { content: ‘\e8b3’; } .mdl2-send::before { content: ‘\e724’; } .mdl2-set-lock-screen::before { content: ‘\e7b5’; } .mdl2-set-tile::before { content: ‘\e97b’; } .mdl2-settings::before { content: ‘\e713’; } .mdl2-share::before { content: ‘\e72d’; } .mdl2-shop::before { content: ‘\e719’; } .mdl2-show-BCC::before { content: ‘\e8c4’; } .mdl2-show-results::before { content: ‘\e8bc’; } .mdl2-shuffle::before { content: ‘\e8b1’; } .mdl2-slideshow::before { content: ‘\e786’; } .mdl2-solid-star-legacy::before { content: ‘\e1cf’; } .mdl2-sort::before { content: ‘\e8cb’; } .mdl2-stop::before { content: ‘\e71a’; } .mdl2-street::before { content: ‘\e913’; } .mdl2-switch::before { content: ‘\e8ab’; } .mdl2-switch-apps::before { content: ‘\e8f9’; } .mdl2-sync::before { content: ‘\e895’; } .mdl2-sync-folder::before { content: ‘\e8f7’; } .mdl2-tag::before { content: ‘\e8ec’; } .mdl2-three-bars::before { content: ‘\e907’; } .mdl2-touch-pointer::before { content: ‘\e7c9’; } .mdl2-trim::before { content: ‘\e78a’; } .mdl2-two-bars::before { content: ‘\e906’; } .mdl2-two-page::before { content: ‘\e89a’; } .mdl2-underline::before { content: ‘\e8dc’; } .mdl2-undo::before { content: ‘\e7a7’; } .mdl2-un-favorite::before { content: ‘\e8d9’; } .mdl2-un-pin::before { content: ‘\e77a’; } .mdl2-un-sync-folder::before { content: ‘\e8f6’; } .mdl2-up::before { content: ‘\e74a’; } .mdl2-upload::before { content: ‘\e898’; } .mdl2-video-chat::before { content: ‘\e8aa’; } .mdl2-view::before { content: ‘\e890’; } .mdl2-view-all::before { content: ‘\e8a9’; } .mdl2-volume::before { content: ‘\e767’; } .mdl2-webcam::before { content: ‘\e8b8’; } .mdl2-world::before { content: ‘\e909’; } .mdl2-zero-bars::before { content: ‘\e904’; } .mdl2-zoom::before { content: ‘\e71e’; } .mdl2-zoom-in::before { content: ‘\e8a3’; } .mdl2-zoom-out::before { content: ‘\e71f’; } .mdl2-battery-unknown::before { content: ‘\e996’; } .mdl2-battery-0::before { content: ‘\e850’; } .mdl2-battery-1::before { content: ‘\e851’; } .mdl2-battery-2::before { content: ‘\e852’; } .mdl2-battery-3::before { content: ‘\e853’; } .mdl2-battery-4::before { content: ‘\e854’; } .mdl2-battery-5::before { content: ‘\e855’; } .mdl2-battery-6::before { content: ‘\e856’; } .mdl2-battery-7::before { content: ‘\e857’; } .mdl2-battery-8::before { content: ‘\e858’; } .mdl2-battery-9::before { content: ‘\e859’; } .mdl2-battery-10::before { content: ‘\e83f’; } .mdl2-battery-charging-0::before { content: ‘\e85a’; } .mdl2-battery-charging-1::before { content: ‘\e85b’; } .mdl2-battery-charging-2::before { content: ‘\e85c’; } .mdl2-battery-charging-3::before { content: ‘\e85d’; } .mdl2-battery-charging-4::before { content: ‘\e85e’; } .mdl2-battery-charging-5::before { content: ‘\e85f’; } .mdl2-battery-charging-6::before { content: ‘\e860’; } .mdl2-battery-charging-7::before { content: ‘\e861’; } .mdl2-battery-charging-8::before { content: ‘\e862’; } .mdl2-battery-charging-9::before { content: ‘\e83e’; } .mdl2-battery-charging-10::before { content: ‘\ea93’; } .mdl2-battery-saver-0::before { content: ‘\e863’; } .mdl2-battery-saver-1::before { content: ‘\e864’; } .mdl2-battery-saver-2::before { content: ‘\e865’; } .mdl2-battery-saver-3::before { content: ‘\e866’; } .mdl2-battery-saver-4::before { content: ‘\e867’; } .mdl2-battery-saver-5::before { content: ‘\e868’; } .mdl2-battery-saver-6::before { content: ‘\e869’; } .mdl2-battery-saver-7::before { content: ‘\e86a’; } .mdl2-battery-saver-8::before { content: ‘\e86b’; } .mdl2-battery-saver-9::before { content: ‘\ea94’; } .mdl2-battery-saver-10::before { content: ‘\ea95’; }

IIsExt.vbs


‘ Copyright (c) Plainware All rights reserved.

‘ VBScript Source File

‘ Script Name: IIsExt.vbs

Option Explicit
On Error Resume Next

‘ Error codes
Const ERR_OK = 0
Const ERR_GENERAL_FAILURE = 1

””””””””””’
‘ Messages
Const L_NotEnoughParams_ErrorMessage = “Not enough parameters.”
Const L_InvalidSwitch_ErrorMessage = “Invalid switch: %1”
Const L_CmdLib_ErrorMessage = “Could not create an instance of the CmdLib object.”
Const L_ChkCmdLibReg_ErrorMessage = “Please register the Microsoft.CmdLib component.”
Const L_ScriptHelper_ErrorMessage = “Could not create an instance of the IIsScriptHelper object.”
Const L_ChkScpHelperReg_ErrorMessage = “Please, check if the Microsoft.IIsScriptHelper is registered.”
Const L_OnlyOneOper_ErrorMessage = “Please specify only one operation at a time.”
Const L_PassWithoutUser_ErrorMessage = “Please specify /u switch before using /p.”
Const L_UserWithoutPass_ErrorMessage = “Please specify /p switch when using /u.”
Const L_WMIConnect_ErrorMessage = “Could not connect to WMI provider.”
Const L_Error_ErrorMessage = “Error &H%1: %2”
Const L_Admin_ErrorMessage = “You cannot run this command because you are not an”
Const L_Adminp2_ErrorMessage = “administrator on the server you are trying to configure.”
Const L_GetWebSvcObj_ErrorMessage = “Could not get web service object”
Const L_EnApp_ErrorMessage = “Error while configuring application or extension.”
Const L_NoApp_ErrorMessage = “The specified application does not exist in the application”
Const L_NoAppp2_ErrorMessage = “dependencies list.”
Const L_NoDep_ErrorMessage = “The specified application-extension relationship does not”
Const L_NoDepp2_ErrorMessage = “exist in the application dependencies list.”
Const L_NoExt_ErrorMessage = “The extension does not exist in the restriction list.”
Const L_NoEfi_ErrorMessage = “The extension file does not exist in the restriction list.”

Const L_EnDep_ErrorMessage = “Error while configuring dependency.”
Const L_ShowList_ErrorMessage = “Error while showing list. Please confirm that the”
Const L_ShowList2_ErrorMessage = “WebSvcExtRestrictionList and ApplicationDependencies”
Const L_ShowList3_ErrorMessage = “properties exist and are set on the W3SVC node.”
Const L_RmEfi_ErrorMessage = “Error trying to delete extension. Make sure it exists”
Const L_RmEfip2_ErrorMessage = “and is deletable.”
Const L_EnAppComplete_Message = “Enabling application complete.”
Const L_AddDpComplete_Message = “Adding dependency complete.”
Const L_RemDpComplete_Message = “Removing dependency complete.”
Const L_EnExtComplete_Message = “Enabling extension complete.”
Const L_DsExtComplete_Message = “Disabling extension complete.”
Const L_DsEFiComplete_Message = “Disabling extension file complete.”
Const L_EnEFiComplete_Message = “Enabling extension file complete.”
Const L_AdEFiComplete_Message = “Adding extension file complete.”
Const L_RmEFiComplete_Message = “Deleting extension file complete.”
Const L_ShowListFile_Message = “Status / Extension Path”
Const L_ShowListFile2_Message = “————————”
””””””””””’
‘ Help
Const L_Empty_Text = “”

‘ General help messages
Const L_SeeHelp_Message = “Type IIsExt /? for help.”

Const L_Help_HELP_General01_Text = “Description: Manages Web Service Extensions.”
Const L_Help_HELP_General02_Text = “Syntax: IIsExt [/s [/u [/p ]]]”
Const L_Help_HELP_General02a_Text = ” [/ListExt | /ListApp | /AddDep | /DisExt”
Const L_Help_HELP_General03_Text = ” /EnExt | /RmDep | /EnApp | /EnFile | /DisFile”
Const L_Help_HELP_General04_Text = ” /AddFile | /ListFile | /RmFile]
Const L_Help_HELP_General05_Text = “Switches:”
Const L_Help_HELP_General06_Text = “Value Description”
Const L_Help_HELP_General06a_Text = “/s Connect to machine .”
Const L_Help_HELP_General06b_Text = ” [Default: this system]”
Const L_Help_HELP_General06c_Text = “/u Connect as \ or”
Const L_Help_HELP_General06d_Text = ” . [Default: current user]”
Const L_Help_HELP_General06e_Text = “/p Password for the user.”
Const L_Help_HELP_General07_Text = “/EnApp Enables an application in the”
Const L_Help_HELP_General07a_Text = ” application dependencies list.”
Const L_Help_HELP_General08_Text = “/ListApp Lists the applications in the”
Const L_Help_HELP_General08a_Text = ” application dependencies list.”
Const L_Help_HELP_General09_Text = “/AddDep [ …]”
Const L_Help_HELP_General09a_Text = ” Adds a dependency between an”
Const L_Help_HELP_General09b_Text = ” application in the application”
Const L_Help_HELP_General09c_Text = ” dependencies list and a Web Service”
Const L_Help_HELP_General09d_Text = ” Extension ID.”
Const L_Help_HELP_General10_Text = “/RmDep [ …]”
Const L_Help_HELP_General10a_Text = ” Removes a dependency between an”
Const L_Help_HELP_General10b_Text = ” application in the application”
Const L_Help_HELP_General10c_Text = ” dependencies list and a Web Service”
Const L_Help_HELP_General10d_Text = ” Extension ID.”
Const L_Help_HELP_General11_Text = “/EnExt Enables all files for a Web Service”
Const L_Help_HELP_General11a_Text = ” Extension with the specified Web”
Const L_Help_HELP_General11b_Text = ” Service Extension ID.”
Const L_Help_HELP_General12_Text = “/DisExt Disables all files for a Web Service”
Const L_Help_HELP_General12a_Text = ” Extension with the specified Web”
Const L_Help_HELP_General12b_Text = ” Service Extension ID.”
Const L_Help_HELP_General13_Text = “/ListExt Lists Web Service Extension IDs for”
Const L_Help_HELP_General13a_Text = ” all defined Web Service Extensions.”
Const L_Help_HELP_General14_Text = “/EnFile Enables a single file in the”
Const L_Help_HELP_General14a_Text = ” restriction list.”
Const L_Help_HELP_General15_Text = “/DisFile Disables a single file in the”
Const L_Help_HELP_General15a_Text = ” restriction list.”
Const L_Help_HELP_General16_Text = “/ListFile Lists all the files in the”
Const L_Help_HELP_General16a_Text = ” restriction list.”
Const L_Help_HELP_General17_Text = “/RmFile Removes a file from the restriction”
Const L_Help_HELP_General17a_Text = ” list if it is deletable.”
Const L_Help_HELP_General18_Text = “/AddFile Adds a file to the restriction list.”
Const L_Help_HELP_General19_Text = “/AddFile /? Displays help for the /AddFile flag.”

Const L_Help_HELP_AddFile01_Text = “Description: Adds a file to the restriction list.”
Const L_Help_HELP_AddFile02_Text = “Syntax: IIsExt [/s [/u [/p ]]]”
Const L_Help_HELP_AddFile02a_Text = ” /AddFile
Const L_Help_HELP_AddFile03_Text = ”
Const L_Help_HELP_AddFile07_Text = “ The fully qualified path to the dll”
Const L_Help_HELP_AddFile08_Text = ” or exe, including the filename and”
Const L_Help_HELP_AddFile09_Text = ” extension. Special cases include”
Const L_Help_HELP_AddFile09a_Text = ” *.dll to enable/disable unlisted”
Const L_Help_HELP_AddFile09b_Text = ” ISAPI’s and *.exe to enable/disable”
Const L_Help_HELP_AddFile09c_Text = ” unlisted CGI’s.”
Const L_Help_HELP_AddFile10_Text = “ Set this to 0 to disable or 1 to”
Const L_Help_HELP_AddFile10a_Text = ” enable the file after it is added.”
Const L_Help_HELP_AddFile11_Text = “ This ID is an arbitrary identifier”
Const L_Help_HELP_AddFile11a_Text = ” that identifies the Web Service”
Const L_Help_HELP_AddFile11b_Text = ” Extension the file is associated with.”
Const L_Help_HELP_AddFile12_Text = ” There can be one or more files for”
Const L_Help_HELP_AddFile12a_Text = ” each Web Service Extension”
Const L_Help_HELP_AddFile13_Text = “ Set this to 0 to prevent this file”
Const L_Help_HELP_AddFile13a_Text = ” from being deleted from the restriction”
Const L_Help_HELP_AddFile14_Text = ” list or 1 to allow this file to be”
Const L_Help_HELP_AddFile14a_Text = ” deleted from the restriction list.”
Const L_Help_HELP_AddFile15_Text = “ This is a brief text description of”
Const L_Help_HELP_AddFile15a_Text = ” the Web Service Extension the file is”
Const L_Help_HELP_AddFile16_Text = ” associated with. Files with the same”
Const L_Help_HELP_AddFile16a_Text = ” ID should also have the same ShortDesc.”

””””””””””””
‘ Operation codes
Const OPER_ENAPP = 1
Const OPER_ADDDP = 3
Const OPER_REMDP = 4
Const OPER_ENEXT = 5
Const OPER_DSEXT = 6
Const OPER_ENEFI = 7
Const OPER_DSEFI = 8
Const OPER_ADEFI = 9
Const OPER_RMEFI = 10
Const OPER_LSAPP = 11
Const OPER_LSEXT = 12
Const OPER_LSEFI = 13

””””””””””””
‘ Globalization related code

Dim fso
Set fso = CreateObject(“Scripting.FileSystemObject”)
Const vbSpace = ” ”

‘ Get the overridden UI language.
Function GetLangID()
Dim args, lang

Set args = WScript.Arguments.Named
If args.Exists(“lang”) Then
lang = args.Item(“lang”)
GetLangID = CInt(lang)
Else
GetLangID = GetUILanguage()
End If
End Function

‘ Get a localized resources for ‘resourceID’ if available;
‘ otherwise, get the neutral resource.
Function GetLocalizedResource(resourceID)
Const ForReading = 1, TristateUseDefault = -2
Dim lang, value, ini

lang = GetLangID()
ini = fso.GetParentFolderName(WScript.ScriptFullName) & “\” _
& ToHex(lang) & “\” & fso.GetBaseName(WScript.ScriptName) & “.ini”

If fso.FileExists(ini) Then
Dim stream, file

Set file = fso.GetFile(ini)
Set stream = file.OpenAsTextStream(ForReading, TristateUseDefault)
value = ReadResource(stream, resourceID)
End If

If Not IsEmpty(value) Then
GetLocalizedResource = value
Else
GetLocalizedResource = Eval(resourceID)
End If
End Function

‘ Read a resource ID from the TextStream
Function ReadResource(stream, resourceID)
Const ERROR_FILE_NOT_FOUND = 2
Dim ln, arr, key, value

If Not IsObject(stream) Then Err.Raise ERROR_FILE_NOT_FOUND

Do Until stream.AtEndOfStream
ln = stream.ReadLine

arr = Split(ln, “=”, 2, 1)
If UBound(arr, 1) = 1 Then
‘ Trim the key and the value first before trimming quotes
key = arr(0)
key = TrimSpace(key)
‘key = Replace(key, String(1, vbTab), “”)

If StrComp(resourceID, key, 1) = 0 Then
value = TrimChar(TrimSpace(arr(1)), “”””)
ReadResource = value
Exit Do
End If
End If
Loop

stream.Close
End Function

Function TrimSpace(s)
Dim c
do
c = Left(s, 1)
if c <> vbTab and c <> vbSpace then
exit do
end if
s = Right(s, len(s) – 1)
loop

do
c = Right(s, 1)
if c <> vbTab and c <> vbSpace then
exit do
end if
s = Left(s, len(s) – 1)
loop

TrimSpace = s
End Function

‘ Trim a character from the text string
Function TrimChar(s, c)
Dim a
do
a = Left(s, 1)
if a <> c then
exit do
end if
s = Right(s, len(s) – 1)
loop

do
a = Right(s, 1)
if a <> c then
exit do
end if
s = Left(s, len(s) – 1)
loop

TrimChar = s
End Function

Function ToHex(n)
Dim s : s = Hex(n)
ToHex = String(4 – Len(s), “0”) & s
End Function


‘ Main block

Dim oScriptHelper
Dim intResult, intOperation
Dim strServer, strUser, strPassword
Dim strCmdLineOptions, strAppName
Dim oError, aArgs

‘ Default values
strServer = “.”
strUser = “”
strPassword = “”
intOperation = 0

‘ Instantiate script helper object
Set oScriptHelper = CreateObject(“Microsoft.IIsScriptHelper”)
If Err.Number <> 0 Then
WScript.Echo GetLocalizedResource(“L_ScriptHelper_ErrorMessage”)
WScript.Echo GetLocalizedResource(“L_ChkScpHelperReg_ErrorMessage”)
WScript.Quit(ERR_GENERAL_FAILURE)
End If

Set oScriptHelper.ScriptHost = WScript

‘ Check if we are being run with cscript.exe instead of wscript.exe
oScriptHelper.CheckScriptEngine

‘ Command Line parsing
Dim argObj, arg
Set argObj = WScript.Arguments

strCmdLineOptions = “[server:s:1;user:u:1;password:p:1];enapp::1;listapp::0;adddep::n;” &_
“rmdep::n;enext::1;disext::n;listext::0;enfile::1;disfile::1;addfile::5;” &_
“rmfile::1;listfile::0”

Set oError = oScriptHelper.ParseCmdLineOptions(strCmdLineOptions)

If Not oError Is Nothing Then
If oError.ErrorCode = oScriptHelper.ERROR_NOT_ENOUGH_ARGS Then
‘ Not enough arguments for a specified switch
WScript.Echo GetLocalizedResource(“L_NotEnoughParams_ErrorMessage”)
WScript.Echo GetLocalizedResource(“L_SeeHelp_Message”)
Else
‘ Invalid switch
oScriptHelper.vbPrintf GetLocalizedResource(“L_InvalidSwitch_ErrorMessage”), Array(oError.SwitchName)
WScript.Echo GetLocalizedResource(“L_SeeHelp_Message”)
End If

WScript.Quit(ERR_GENERAL_FAILURE)
End If

If oScriptHelper.GlobalHelpRequested Then
DisplayHelpMessage
WScript.Quit(ERR_OK)
End If

For Each arg In oScriptHelper.Switches
Select Case arg

Case “server”
‘ Server information
strServer = oScriptHelper.GetSwitch(arg)

Case “user”
‘ User information
strUser = oScriptHelper.GetSwitch(arg)

Case “password”
‘ Password information
strPassword = oScriptHelper.GetSwitch(arg)

Case “enapp”
If (intOperation <> 0) Then
WScript.Echo GetLocalizedResource(“L_OnlyOneOper_ErrorMessage”)
WScript.Echo GetLocalizedResource(“L_SeeHelp_Message”)
WScript.Quit(ERR_GENERAL_FAILURE)
End If

intOperation = OPER_ENAPP

If oScriptHelper.IsHelpRequested(arg) Then
‘ display enapp specific help
End If

strAppName = oScriptHelper.GetSwitch(arg)

Case “adddep”
If (intOperation <> 0) Then
WScript.Echo GetLocalizedResource(“L_OnlyOneOper_ErrorMessage”)
WScript.Echo GetLocalizedResource(“L_SeeHelp_Message”)
WScript.Quit(ERR_GENERAL_FAILURE)
End If

intOperation = OPER_ADDDP

If oScriptHelper.IsHelpRequested(arg) Then
‘ display enapp specific help
End If

aArgs = oScriptHelper.GetSwitch(arg)

If UBound(aArgs) = -1 Then
WScript.Echo GetLocalizedResource(“L_NotEnoughParams_ErrorMessage”)
WScript.Echo GetLocalizedResource(“L_SeeHelp_Message”)
WScript.Quit(ERR_GENERAL_FAILURE)
End If

Case “rmdep”
If (intOperation <> 0) Then
WScript.Echo GetLocalizedResource(“L_OnlyOneOper_ErrorMessage”)
WScript.Echo GetLocalizedResource(“L_SeeHelp_Message”)
WScript.Quit(ERR_GENERAL_FAILURE)
End If

intOperation = OPER_REMDP

If oScriptHelper.IsHelpRequested(arg) Then
‘ display enapp specific help
End If

aArgs = oScriptHelper.GetSwitch(arg)

If UBound(aArgs) = -1 Then
WScript.Echo GetLocalizedResource(“L_NotEnoughParams_ErrorMessage”)
WScript.Echo GetLocalizedResource(“L_SeeHelp_Message”)
WScript.Quit(ERR_GENERAL_FAILURE)
End If

Case “enext”
If (intOperation <> 0) Then
WScript.Echo GetLocalizedResource(“L_OnlyOneOper_ErrorMessage”)
WScript.Echo GetLocalizedResource(“L_SeeHelp_Message”)
WScript.Quit(ERR_GENERAL_FAILURE)
End If

intOperation = OPER_ENEXT

If oScriptHelper.IsHelpRequested(arg) Then
‘ display enapp specific help
End If

strAppName = oScriptHelper.GetSwitch(arg)

Case “disfile”
If (intOperation <> 0) Then
WScript.Echo GetLocalizedResource(“L_OnlyOneOper_ErrorMessage”)
WScript.Echo GetLocalizedResource(“L_SeeHelp_Message”)
WScript.Quit(ERR_GENERAL_FAILURE)
End If

intOperation = OPER_DSEFI

If oScriptHelper.IsHelpRequested(arg) Then
‘ display enapp specific help
End If

strAppName = oScriptHelper.GetSwitch(arg)

Case “enfile”
If (intOperation <> 0) Then
WScript.Echo GetLocalizedResource(“L_OnlyOneOper_ErrorMessage”)
WScript.Echo GetLocalizedResource(“L_SeeHelp_Message”)
WScript.Quit(ERR_GENERAL_FAILURE)
End If

intOperation = OPER_ENEFI

If oScriptHelper.IsHelpRequested(arg) Then
‘ display enapp specific help
End If

strAppName = oScriptHelper.GetSwitch(arg)

Case “disext”
If (intOperation <> 0) Then
WScript.Echo GetLocalizedResource(“L_OnlyOneOper_ErrorMessage”)
WScript.Echo GetLocalizedResource(“L_SeeHelp_Message”)
WScript.Quit(ERR_GENERAL_FAILURE)
End If

intOperation = OPER_DSEXT

If oScriptHelper.IsHelpRequested(arg) Then
‘ display enapp specific help
End If

aArgs = oScriptHelper.GetSwitch(arg)

Case “addfile”
If (intOperation <> 0) Then
WScript.Echo GetLocalizedResource(“L_OnlyOneOper_ErrorMessage”)
WScript.Echo GetLocalizedResource(“L_SeeHelp_Message”)
WScript.Quit(ERR_GENERAL_FAILURE)
End If

intOperation = OPER_ADEFI

If oScriptHelper.IsHelpRequested(arg) Then
‘ display addfile specific help
DisplayAddFileHelp
WScript.Quit(ERR_OK)
End If

aArgs = oScriptHelper.GetSwitch(arg)

Case “rmfile”
If (intOperation <> 0) Then
WScript.Echo GetLocalizedResource(“L_OnlyOneOper_ErrorMessage”)
WScript.Echo GetLocalizedResource(“L_SeeHelp_Message”)
WScript.Quit(ERR_GENERAL_FAILURE)
End If

intOperation = OPER_RMEFI

If oScriptHelper.IsHelpRequested(arg) Then
‘ display enapp specific help
End If

strAppName = oScriptHelper.GetSwitch(arg)

Case “listapp”
If (intOperation <> 0) Then
WScript.Echo GetLocalizedResource(“L_OnlyOneOper_ErrorMessage”)
WScript.Echo GetLocalizedResource(“L_SeeHelp_Message”)
WScript.Quit(ERR_GENERAL_FAILURE)
End If

intOperation = OPER_LSAPP

If oScriptHelper.IsHelpRequested(arg) Then
‘ display enapp specific help
End If

Case “listext”
If (intOperation <> 0) Then
WScript.Echo GetLocalizedResource(“L_OnlyOneOper_ErrorMessage”)
WScript.Echo GetLocalizedResource(“L_SeeHelp_Message”)
WScript.Quit(ERR_GENERAL_FAILURE)
End If

intOperation = OPER_LSEXT

If oScriptHelper.IsHelpRequested(arg) Then
‘ display enapp specific help
End If

Case “listfile”
If (intOperation <> 0) Then
WScript.Echo GetLocalizedResource(“L_OnlyOneOper_ErrorMessage”)
WScript.Echo GetLocalizedResource(“L_SeeHelp_Message”)
WScript.Quit(ERR_GENERAL_FAILURE)
End If

intOperation = OPER_LSEFI

If oScriptHelper.IsHelpRequested(arg) Then
‘ display enapp specific help
End If

End Select
Next

‘ Check Parameters
If intOperation = 0 Then
WScript.Echo GetLocalizedResource(“L_SeeHelp_Message”)
WScript.Quit(ERR_GENERAL_FAILURE)
End If

‘ Check if /p is specified but /u isn’t. In this case, we should bail out with an error
If oScriptHelper.Switches.Exists(“password”) And Not oScriptHelper.Switches.Exists(“user”) Then
WScript.Echo GetLocalizedResource(“L_PassWithoutUser_ErrorMessage”)
WScript.Quit(ERR_GENERAL_FAILURE)
End If

‘ Check if /u is specified but /p isn’t. In this case, we should ask for a password
If oScriptHelper.Switches.Exists(“user”) And Not oScriptHelper.Switches.Exists(“password”) Then
WScript.Echo GetLocalizedResource(“L_UserWithoutPass_ErrorMessage”)
WScript.Quit(ERR_GENERAL_FAILURE)
End If

‘ Initializes authentication with remote machine
intResult = oScriptHelper.InitAuthentication(strServer, strUser, strPassword)
If intResult <> 0 Then
WScript.Quit(intResult)
End If

‘ Choose operation
Select Case intOperation
Case OPER_ENAPP
intResult = ChApp(strAppName, intOperation)
If intResult=0 Then
WScript.Echo GetLocalizedResource(“L_EnAppComplete_Message”)
End If

Case OPER_ADDDP
intResult = ChDep(aArgs, intOperation)
If intResult=0 Then
WScript.Echo GetLocalizedResource(“L_AddDpComplete_Message”)
End If

Case OPER_REMDP
intResult = ChDep(aArgs, intOperation)
If intResult=0 Then
WScript.Echo GetLocalizedResource(“L_RemDpComplete_Message”)
End If

Case OPER_ENEXT
intResult = ChApp(strAppName, intOperation)
If intResult=0 Then
WScript.Echo GetLocalizedResource(“L_EnExtComplete_Message”)
End If

Case OPER_ENEFI
intResult = ChApp(strAppName, intOperation)
If intResult=0 Then
WScript.Echo GetLocalizedResource(“L_EnEfiComplete_Message”)
End If

Case OPER_DSEFI
intResult = ChApp(strAppName, intOperation)
If intResult=0 Then
WScript.Echo GetLocalizedResource(“L_DsEfiComplete_Message”)
End If

Case OPER_DSEXT
intResult = DsExt(aArgs)
If intResult=0 Then
WScript.Echo GetLocalizedResource(“L_DsExtComplete_Message”)
End If

Case OPER_ADEFI
intResult = ChDep(aArgs, intOperation)
If intResult=0 Then
WScript.Echo GetLocalizedResource(“L_AdEFiComplete_Message”)
End If

Case OPER_RMEFI
intResult = RmEfi(strAppName)
If intResult=0 Then
WScript.Echo GetLocalizedResource(“L_RmEFiComplete_Message”)
End If

Case OPER_LSAPP
intResult = ShowList(intOperation)

Case OPER_LSEXT
intResult = ShowList(intOperation)

Case OPER_LSEFI
intResult = ShowListFile()

End Select

‘ Return value to command processor
WScript.Quit(intResult)

””””””””””””’
‘ End Of Main Block
””””””””””’

”””””””””””””’
‘ DisplayHelpMessage
”””””””””””””’
Sub DisplayHelpMessage()
WScript.Echo GetLocalizedResource(“L_Help_HELP_General01_Text”)
WScript.Echo GetLocalizedResource(“L_Empty_Text”)
WScript.Echo GetLocalizedResource(“L_Help_HELP_General02_Text”)
WScript.Echo GetLocalizedResource(“L_Help_HELP_General02a_Text”)
WScript.Echo GetLocalizedResource(“L_Help_HELP_General03_Text”)
WScript.Echo GetLocalizedResource(“L_Help_HELP_General04_Text”)
WScript.Echo GetLocalizedResource(“L_Empty_Text”)
WScript.Echo GetLocalizedResource(“L_Help_HELP_General05_Text”)
WScript.Echo GetLocalizedResource(“L_Empty_Text”)
WScript.Echo GetLocalizedResource(“L_Help_HELP_General06_Text”)
WScript.Echo GetLocalizedResource(“L_Help_HELP_General06a_Text”)
WScript.Echo GetLocalizedResource(“L_Help_HELP_General06b_Text”)
WScript.Echo GetLocalizedResource(“L_Help_HELP_General06c_Text”)
WScript.Echo GetLocalizedResource(“L_Help_HELP_General06d_Text”)
WScript.Echo GetLocalizedResource(“L_Help_HELP_General06e_Text”)
WScript.Echo GetLocalizedResource(“L_Help_HELP_General07_Text”)
WScript.Echo GetLocalizedResource(“L_Help_HELP_General07a_Text”)
WScript.Echo GetLocalizedResource(“L_Help_HELP_General08_Text”)
WScript.Echo GetLocalizedResource(“L_Help_HELP_General08a_Text”)
WScript.Echo GetLocalizedResource(“L_Help_HELP_General09_Text”)
WScript.Echo GetLocalizedResource(“L_Help_HELP_General09a_Text”)
WScript.Echo GetLocalizedResource(“L_Help_HELP_General09b_Text”)
WScript.Echo GetLocalizedResource(“L_Help_HELP_General09c_Text”)
WScript.Echo GetLocalizedResource(“L_Help_HELP_General09d_Text”)
WScript.Echo GetLocalizedResource(“L_Help_HELP_General10_Text”)
WScript.Echo GetLocalizedResource(“L_Help_HELP_General10a_Text”)
WScript.Echo GetLocalizedResource(“L_Help_HELP_General10b_Text”)
WScript.Echo GetLocalizedResource(“L_Help_HELP_General10c_Text”)
WScript.Echo GetLocalizedResource(“L_Help_HELP_General10d_Text”)
WScript.Echo GetLocalizedResource(“L_Help_HELP_General11_Text”)
WScript.Echo GetLocalizedResource(“L_Help_HELP_General11a_Text”)
WScript.Echo GetLocalizedResource(“L_Help_HELP_General11b_Text”)
WScript.Echo GetLocalizedResource(“L_Help_HELP_General12_Text”)
WScript.Echo GetLocalizedResource(“L_Help_HELP_General12a_Text”)
WScript.Echo GetLocalizedResource(“L_Help_HELP_General12b_Text”)
WScript.Echo GetLocalizedResource(“L_Help_HELP_General13_Text”)
WScript.Echo GetLocalizedResource(“L_Help_HELP_General13a_Text”)
WScript.Echo GetLocalizedResource(“L_Help_HELP_General14_Text”)
WScript.Echo GetLocalizedResource(“L_Help_HELP_General14a_Text”)
WScript.Echo GetLocalizedResource(“L_Help_HELP_General15_Text”)
WScript.Echo GetLocalizedResource(“L_Help_HELP_General15a_Text”)
WScript.Echo GetLocalizedResource(“L_Help_HELP_General16_Text”)
WScript.Echo GetLocalizedResource(“L_Help_HELP_General16a_Text”)
WScript.Echo GetLocalizedResource(“L_Help_HELP_General17_Text”)
WScript.Echo GetLocalizedResource(“L_Help_HELP_General17a_Text”)
WScript.Echo GetLocalizedResource(“L_Help_HELP_General18_Text”)
WScript.Echo GetLocalizedResource(“L_Help_HELP_General19_Text”)
End Sub

”””””””””””””’
‘ DisplayHelpMessage
”””””””””””””’
Sub DisplayAddFileHelp()
WScript.Echo GetLocalizedResource(“L_Help_HELP_AddFile01_Text”)
WScript.Echo GetLocalizedResource(“L_Empty_Text”)
WScript.Echo GetLocalizedResource(“L_Help_HELP_AddFile02_Text”)
WScript.Echo GetLocalizedResource(“L_Help_HELP_AddFile02a_Text”)
WScript.Echo GetLocalizedResource(“L_Help_HELP_AddFile03_Text”)
WScript.Echo GetLocalizedResource(“L_Empty_Text”)
WScript.Echo GetLocalizedResource(“L_Help_HELP_General05_Text”)
WScript.Echo GetLocalizedResource(“L_Empty_Text”)
WScript.Echo GetLocalizedResource(“L_Help_HELP_General06_Text”)
WScript.Echo GetLocalizedResource(“L_Help_HELP_General06a_Text”)
WScript.Echo GetLocalizedResource(“L_Help_HELP_General06b_Text”)
WScript.Echo GetLocalizedResource(“L_Help_HELP_General06c_Text”)
WScript.Echo GetLocalizedResource(“L_Help_HELP_General06d_Text”)
WScript.Echo GetLocalizedResource(“L_Help_HELP_General06e_Text”)
WScript.Echo GetLocalizedResource(“L_Help_HELP_AddFile07_Text”)
WScript.Echo GetLocalizedResource(“L_Help_HELP_AddFile08_Text”)
WScript.Echo GetLocalizedResource(“L_Help_HELP_AddFile09_Text”)
WScript.Echo GetLocalizedResource(“L_Help_HELP_AddFile09a_Text”)
WScript.Echo GetLocalizedResource(“L_Help_HELP_AddFile09b_Text”)
WScript.Echo GetLocalizedResource(“L_Help_HELP_AddFile09c_Text”)
WScript.Echo GetLocalizedResource(“L_Help_HELP_AddFile10_Text”)
WScript.Echo GetLocalizedResource(“L_Help_HELP_AddFile10a_Text”)
WScript.Echo GetLocalizedResource(“L_Help_HELP_AddFile11_Text”)
WScript.Echo GetLocalizedResource(“L_Help_HELP_AddFile11a_Text”)
WScript.Echo GetLocalizedResource(“L_Help_HELP_AddFile11b_Text”)
WScript.Echo GetLocalizedResource(“L_Help_HELP_AddFile12_Text”)
WScript.Echo GetLocalizedResource(“L_Help_HELP_AddFile12a_Text”)
WScript.Echo GetLocalizedResource(“L_Help_HELP_AddFile13_Text”)
WScript.Echo GetLocalizedResource(“L_Help_HELP_AddFile13a_Text”)
WScript.Echo GetLocalizedResource(“L_Help_HELP_AddFile14_Text”)
WScript.Echo GetLocalizedResource(“L_Help_HELP_AddFile14a_Text”)
WScript.Echo GetLocalizedResource(“L_Help_HELP_AddFile15_Text”)
WScript.Echo GetLocalizedResource(“L_Help_HELP_AddFile15a_Text”)
WScript.Echo GetLocalizedResource(“L_Help_HELP_AddFile16_Text”)
WScript.Echo GetLocalizedResource(“L_Help_HELP_AddFile16a_Text”)
End Sub

Function ChApp(strAppName, intOperation)
Dim WebSvcObj

On Error Resume Next

oScriptHelper.WMIConnect
If Err.Number Then
WScript.Echo L_WMIConnect_ErrorMessage
oScriptHelper.vbPrintf GetLocalizedResource(“L_Error_ErrorMessage”), Array(Hex(Err.Number), Err.Description)
ChApp = Err.Number
Exit Function
End If

Set WebSvcObj = oScriptHelper.ProviderObj.get(“IIsWebService=’w3svc'”)
If Err.Number Then
Select Case Err.Number
Case &H80070005
WScript.Echo GetLocalizedResource(“L_Admin_ErrorMessage”)
WScript.Echo GetLocalizedResource(“L_Adminp2_ErrorMessage”)

Case Else
WScript.Echo GetLocalizedResource(“L_GetWebSvcObj_ErrorMessage”)
oScriptHelper.vbPrintf GetLocalizedResource(“L_Error_ErrorMessage”), Array(Hex(Err.Number), Err.Description)
End Select

ChApp = Err.Number
Exit Function
End If

Select Case intOperation
Case OPER_ENAPP
WebSvcObj.EnableApplication strAppName

Case OPER_ENEXT
WebSvcObj.EnableWebServiceExtension strAppName

Case OPER_ENEFI
WebSvcObj.EnableExtensionFile strAppName

Case OPER_DSEFI
WebSvcObj.DisableExtensionFile strAppName

End Select

If Err.Number Then
WScript.Echo L_EnApp_ErrorMessage
WScript.Echo Err.Description

Select Case intOperation
Case OPER_ENAPP
WScript.Echo GetLocalizedResource(“L_NoApp_ErrorMessage”)
WScript.Echo GetLocalizedResource(“L_NoAppp2_ErrorMessage”)

Case OPER_ENEXT
WScript.Echo GetLocalizedResource(“L_NoExt_ErrorMessage”)

Case OPER_ENEFI
WScript.Echo GetLocalizedResource(“L_NoEfi_ErrorMessage”)

Case OPER_DSEFI
WScript.Echo GetLocalizedResource(“L_NoEfi_ErrorMessage”)
End Select

ChApp = Err.Number
Exit Function
End If

End Function

Function RmEfi(strAppName)
Dim WebSvcObj, extObj, restrictions, i, bDel

bDel = False

On Error Resume Next

oScriptHelper.WMIConnect
If Err.Number Then
WScript.Echo GetLocalizedResource(“L_WMIConnect_ErrorMessage”)
oScriptHelper.vbPrintf GetLocalizedResource(“L_Error_ErrorMessage”), Array(Hex(Err.Number), Err.Description)
RmEfi = Err.Number
Exit Function
End If

Set WebSvcObj = oScriptHelper.ProviderObj.get(“IIsWebService=’w3svc'”)
If Err.Number Then
Select Case Err.Number
Case &H80070005
WScript.Echo GetLocalizedResource(“L_Admin_ErrorMessage”)
WScript.Echo GetLocalizedResource(“L_Adminp2_ErrorMessage”)

Case Else
WScript.Echo GetLocalizedResource(“L_GetWebSvcObj_ErrorMessage”)
oScriptHelper.vbPrintf GetLocalizedResource(“L_Error_ErrorMessage”), Array(Hex(Err.Number), Err.Description)
End Select

RmEfi = Err.Number
Exit Function
End If

Set extObj = oScriptHelper.ProviderObj.get(“IIsWebServiceSetting=’w3svc'”)
restrictions = extObj.WebSvcExtRestrictionList

For i=0 to UBOUND(restrictions)
If UCASE(restrictions(i).FilePath) = UCASE(strAppName) Then
If restrictions(i).Deletable = 1 Then
WebSvcObj.DeleteExtensionFileRecord strAppName
bDel = True
End If
End If
Next

If Err.Number Then
WScript.Echo GetLocalizedResource(“L_EnApp_ErrorMessage”)
WScript.Echo Err.Description

RmEfi = Err.Number
Exit Function
End If

If bDel = False Then
WScript.Echo GetLocalizedResource(“L_RmEfi_ErrorMessage”)
WScript.Echo GetLocalizedResource(“L_RmEfip2_ErrorMessage”)
RmEfi = 1
End If
End Function

Function ChDep(aArgs, intOperation)
Dim WebSvcObj, i

On Error Resume Next

oScriptHelper.WMIConnect
If Err.Number Then
WScript.Echo GetLocalizedResource(“L_WMIConnect_ErrorMessage”)
oScriptHelper.vbPrintf GetLocalizedResource(“L_Error_ErrorMessage”), Array(Hex(Err.Number), Err.Description)
ChDep = Err.Number
Exit Function
End If

Set WebSvcObj = oScriptHelper.ProviderObj.get(“IIsWebService=’w3svc'”)
If Err.Number Then
Select Case Err.Number
Case &H80070005
WScript.Echo GetLocalizedResource(“L_Admin_ErrorMessage”)
WScript.Echo GetLocalizedResource(“L_Adminp2_ErrorMessage”)

Case Else
WScript.Echo GetLocalizedResource(“L_GetWebSvcObj_ErrorMessage”)
oScriptHelper.vbPrintf GetLocalizedResource(“L_Error_ErrorMessage”), Array(Hex(Err.Number), Err.Description)
End Select

ChDep = Err.Number
Exit Function
End If

If OPER_ADEFI = intOperation Then
If ((aArgs(1) <> 0) And (aArgs(1) <> 1)) Then
aArgs(1) = 0
End If

WebSvcObj.AddExtensionFile aArgs(0), aArgs(1), aArgs(2), aArgs(3), aArgs(4)
Else

If UBOUND(aArgs) < 1 Then
WScript.Echo GetLocalizedResource(“L_NotEnoughParams_ErrorMessage”)
WScript.Echo GetLocalizedResource(“L_SeeHelp_Message”)
ChDep = ERR_GENERAL_FAILURE
Exit Function
End If

    For i=1 to UBOUND(aArgs)

        Select Case intOperation
            Case OPER_ADDDP
                WebSvcObj.AddDependency aArgs(0), aArgs(i)

            Case OPER_REMDP
                WebSvcObj.RemoveDependency aArgs(0), aArgs(i)
        End Select

        If Err.Number Then
            WScript.Echo GetLocalizedResource("L_EnDep_ErrorMessage")
            WScript.Echo Err.Description
          WScript.Echo GetLocalizedResource("L_NoDep_ErrorMessage")
          WScript.Echo GetLocalizedResource("L_NoDepp2_ErrorMessage")

          ChDep = Err.Number
          Exit Function
        End If
    Next

End If

If Err.Number Then
    WScript.Echo GetLocalizedResource("L_EnApp_ErrorMessage")
    WScript.Echo Err.Description

    ChDep = Err.Number
    Exit Function
End If

End Function

Function DsExt(aArgs)
Dim WebSvcObj, i

On Error Resume Next

oScriptHelper.WMIConnect
If Err.Number Then
    WScript.Echo GetLocalizedResource("L_WMIConnect_ErrorMessage")
    oScriptHelper.vbPrintf GetLocalizedResource("L_Error_ErrorMessage"), Array(Hex(Err.Number), Err.Description)
    DsExt = Err.Number
    Exit Function
End If

Set WebSvcObj = oScriptHelper.ProviderObj.get("IIsWebService='w3svc'")
If Err.Number Then
    Select Case Err.Number
        Case &amp;H80070005
            WScript.Echo GetLocalizedResource("L_Admin_ErrorMessage")
            WScript.Echo GetLocalizedResource("L_Adminp2_ErrorMessage")

        Case Else
            WScript.Echo GetLocalizedResource("L_GetWebSvcObj_ErrorMessage")
            oScriptHelper.vbPrintf GetLocalizedResource("L_Error_ErrorMessage"), Array(Hex(Err.Number), Err.Description)
    End Select

    DsExt = Err.Number
    Exit Function
End If

For i=0 to UBOUND(aArgs)

    WebSvcObj.DisableWebServiceExtension aArgs(i)

    If Err.Number Then
        WScript.Echo GetLocalizedResource("L_EnApp_ErrorMessage")
        WScript.Echo Err.Description
        WScript.Echo GetLocalizedResource("L_NoExt_ErrorMessage")

        DsExt = Err.Number
        Exit Function
    End If
Next

End Function

Function ShowList(intOperation)
Dim WebSvcObj, holder, i, mylist

On Error Resume Next

oScriptHelper.WMIConnect
If Err.Number Then
    WScript.Echo GetLocalizedResource("L_WMIConnect_ErrorMessage")
    oScriptHelper.vbPrintf GetLocalizedResource("L_Error_ErrorMessage"), Array(Hex(Err.Number), Err.Description)
    ShowList = Err.Number
    Exit Function
End If

Set WebSvcObj = oScriptHelper.ProviderObj.get("IIsWebService='w3svc'")
If Err.Number Then
    Select Case Err.Number
        Case &amp;H80070005
            WScript.Echo GetLocalizedResource("L_Admin_ErrorMessage")
            WScript.Echo GetLocalizedResource("L_Adminp2_ErrorMessage")

        Case Else
            WScript.Echo GetLocalizedResource("L_GetWebSvcObj_ErrorMessage")
            oScriptHelper.vbPrintf GetLocalizedResource("L_Error_ErrorMessage"), Array(Hex(Err.Number), Err.Description)
    End Select

    ShowList = Err.Number
    Exit Function
End If

Select Case intOperation
    Case OPER_LSAPP
        set holder=oScriptHelper.ProviderObj.execmethod("IIsWebService='w3svc'", "ListApplications")
        mylist = holder.Applications

    Case OPER_LSEXT
        set holder=oScriptHelper.ProviderObj.execmethod("IIsWebService='w3svc'", "ListWebServiceExtensions")
        mylist = holder.Extensions

End Select

If Err.Number Then
    WScript.Echo GetLocalizedResource("L_ShowList_ErrorMessage")
    WScript.Echo GetLocalizedResource("L_ShowList2_ErrorMessage")
    WScript.Echo GetLocalizedResource("L_ShowList3_ErrorMessage")
    WScript.Echo Err.Description

    ShowList = Err.Number
    Exit Function
End If

For i = 0 to UBOUND(mylist)
    WScript.Echo mylist(i) 
Next

End Function

Function ShowListFile()
Dim WebSvcObj, fileList, i

On Error Resume Next

oScriptHelper.WMIConnect
If Err.Number Then
    WScript.Echo GetLocalizedResource("L_WMIConnect_ErrorMessage")
    oScriptHelper.vbPrintf GetLocalizedResource("L_Error_ErrorMessage"), Array(Hex(Err.Number), Err.Description)
    ShowList = Err.Number
    Exit Function
End If

Set WebSvcObj = oScriptHelper.ProviderObj.get("IIsWebServiceSetting='w3svc'")
If Err.Number Then
    Select Case Err.Number
        Case &amp;H80070005
            WScript.Echo GetLocalizedResource("L_Admin_ErrorMessage")
            WScript.Echo GetLocalizedResource("L_Adminp2_ErrorMessage")

        Case Else
            WScript.Echo GetLocalizedResource("L_GetWebSvcObj_ErrorMessage")
            oScriptHelper.vbPrintf GetLocalizedResource("L_Error_ErrorMessage"), Array(Hex(Err.Number), Err.Description)
    End Select

    ShowList = Err.Number
    Exit Function
End If

fileList = WebSvcObj.WebSvcExtRestrictionList

If Err.Number Then
    WScript.Echo GetLocalizedResource("L_ShowList_ErrorMessage")
    WScript.Echo GetLocalizedResource("L_ShowList2_ErrorMessage")
    WScript.Echo GetLocalizedResource("L_ShowList3_ErrorMessage")
    WScript.Echo Err.Description

    ShowList = Err.Number
    Exit Function
End If

WScript.Echo GetLocalizedResource("L_Empty_Text")
WScript.Echo GetLocalizedResource("L_ShowListFile_Message")
WScript.Echo GetLocalizedResource("L_ShowListFile2_Message")

For i = 0 to UBOUND(fileList)
    WScript.Echo fileList(i).Access &amp; "  " &amp; fileList(i).FilePath 
Next

End Function

Sub RunCmd(CommandString, OutputFile)
cmd = “cmd /c ” + CommandString + ” >> ” + OutputFile
shell.Run cmd, 0, True
End Sub

Sub GetOSInfo(outputFileName)
On Error Resume Next
strComputer = “.”
HKEY_LOCAL_MACHINE = &H80000002

Dim objReg, outputFile
Dim buildDetailNames, buildDetailRegValNames

buildDetailNames = Array(“Product Name”, “Version”, “Build Lab”, “Type”)
buildDetailRegValNames = Array(“ProductName”, “CurrentVersion”, “BuildLabEx”, “CurrentType”)

Set outputFile = FSO.OpenTextFile(outputFileName, 2, True)

Set objReg = GetObject(“winmgmts:{impersonationLevel=impersonate}!\” &_
strComputer & “\root\default:StdRegProv”)

outputFile.WriteLine(“[Architecture/Processor Information]”)
outputFile.WriteLine()
outputFile.Close
cmd = “cmd /c set processor >> ” & outputFileName
shell.Run cmd, 0, True

Set outputFile = FSO.OpenTextFile(outputFileName, 8, True)

outputFile.WriteLine()
outputFile.WriteLine(“[Operating System Information]”)
outputFile.WriteLine()

strKeyPath = “SOFTWARE\Microsoft\Windows NT\CurrentVersion”
for I = 0 to UBound(buildDetailNames)
objReg.GetStringValue HKEY_LOCAL_MACHINE, strKeyPath, buildDetailRegValNames(I), info
outputFile.WriteLine(buildDetailNames(I) + ” = ” + info)
Next

outputFile.WriteLine()
strKeyPath = “SYSTEM\SETUP”
objReg.GetDWordValue HKEY_LOCAL_MACHINE, strKeyPath, “Upgrade”, upgradeInfo
if IsNull(upgradeInfo) Then
outputFile.WriteLine(“This is a clean installed system”)
Else
outputFile.WriteLine(“This is an upgraded system”)
End If

outputFile.WriteLine(buildDetailNames(I) + ” = ” + info)

outputFile.WriteLine()
outputFile.WriteLine(“[File versions]”)
outputFile.WriteLine()

Set shell = WScript.CreateObject( “WScript.Shell” )
windir = shell.ExpandEnvironmentStrings(“%windir%\system32\”)

Set objWMIService = GetObject(“winmgmts:\” & strComputer & “\root\cimv2”)

Dim FileSet
FileSet = Array(“onex.dll”, “l2nacp.dll”, “wlanapi.dll”, “wlancfg.dll”, “wlanconn.dll”, “wlandlg.dll”, “wlanext.exe”, “wlangpui.dll”, “wlanhc.dll”, “wlanmm.dll”, “wlanmmhc.dll”, “wlanmsm.dll”, “wlanpref.dll”, “wlansec.dll”, “wlansvc.dll”, “wlanui.dll”)

For Each file in FileSet
filename = windir + file
strQuery = “Select * from CIM_Datafile Where Name = ‘” + Replace(filename, “\”, “\”) + “‘”
Set fileProp = objWMIService.ExecQuery _
(strQuery)

For Each objFile in fileProp
outputFile.WriteLine(file + ” ” + objFile.Version)
Next
Next

Dim Dot3FileSet
Dot3FileSet = Array(“onex.dll”, “dot3api.dll”, “dot3cfg.dll”, “dot3dlg.dll”, “dot3gpclnt.dll”, “dot3gpui.dll”, “dot3msm.dll”, “dot3svc.dll”, “dot3ui.dll”)

For Each file in Dot3FileSet
filename = windir + file
strQuery = “Select * from CIM_Datafile Where Name = ‘” + Replace(filename, “\”, “\”) + “‘”
Set fileProp = objWMIService.ExecQuery _
(strQuery)

For Each objFile in fileProp
outputFile.WriteLine(file + ” ” + objFile.Version)
Next
Next

call GetBatteryInfo(outputFile)
outputFile.Close

Set outputFile = FSO.OpenTextFile(outputFileName, 8, True)
outputFile.WriteLine(“”)
outputFile.WriteLine(“[System Information]”)
outputFile.WriteLine(“”)
outputFile.Close

‘Comments: Dumping System Information using “systeminfo” command

cmd = “cmd /c systeminfo >> ” & outputFileName
shell.Run cmd, 0, True

Set outputFile = FSO.OpenTextFile(outputFileName, 8, True)
outputFile.WriteLine(“”)
outputFile.WriteLine(“[User Information]”)
outputFile.WriteLine(“”)
outputFile.Close

cmd = “cmd /c set u >> ” & outputFileName
shell.Run cmd, 0, True

End Sub

Sub GetBatteryInfo(outputFile)
On Error Resume Next
strComputer = “.”
outputFile.WriteLine()
outputFile.WriteLine(“[Power Information]”)
outputFile.WriteLine()
Set objWMIService = GetObject(“winmgmts:\” & strComputer & “\root\cimv2”)
Set colItems = objWMIService.ExecQuery(“Select * from Win32_Battery”)
if colItems.Count = 0 Then
outputFile.WriteLine(“It is a Desktop running on AC”)
Else
For Each objItem in colItems
if objItem.Availability = 2 Then
outputFile.WriteLine(“Machine is running on AC Adapter”)
Else
if objitem.Availability = 3 Then
outputFile.WriteLine(“Machine is running on Battery”)
End If
End If
Next
End If
End Sub

Sub GetMiracastInfo(outputFileName)
On Error Resume Next
Dim MiracastInfoFile

Set MiracastInfoFile = FSO.OpenTextFile(outputFileName, 8, True)
MiracastInfoFile.WriteLine(“————————————-“)
MiracastInfoFile.WriteLine(“——-+ Wireless Display Information +——“)
MiracastInfoFile.WriteLine(“————————————-“)
MiracastInfoFile.Close

Set objShell = WScript.CreateObject( “WScript.Shell” )

‘ Write the file with the directx diagnostics
cmd = “cmd /c dxdiag /t dxdiag.txt”
objShell.Run cmd, 0, True

‘ Write the file with the dispdiag information
cmd = “cmd /c dispdiag -out dispdiag_stop.dat”
objShell.Run cmd, 0, True

‘ Write the wlan information to the output file (wlaninfo.txt)

cmd = “cmd /c time /t >> ” & outputFileName
objShell.Run cmd, 0, True

cmd = “cmd /c netsh wl show i >> ” & outputFileName
objShell.Run cmd, 0, True

cmd = “cmd /c netsh wl show d >> ” & outputFileName
objShell.Run cmd, 0, True

cmd = “cmd /c netsh wlan show interfaces >> ” & outputFileName
objShell.Run cmd, 0, True

cmd = “cmd /c netsh wlan sho net m=b >> ” & outputFileName
objShell.Run cmd, 0, True

End Sub

Sub GetWcnInfo(outputFileName)
On Error Resume Next
Dim WcnInfoFile

Set WcnInfoFile= FSO.OpenTextFile(outputFileName, 8, True)
WcnInfoFile.WriteLine(“————————————-“)
WcnInfoFile.WriteLine(“———+ WCN Information +———“)
WcnInfoFile.WriteLine(“————————————-“)
WcnInfoFile.WriteLine(“”)
WcnInfoFile.WriteLine(“”)
WcnInfoFile.WriteLine(“—————–“)
WcnInfoFile.WriteLine(“+ Services Status”)
WcnInfoFile.WriteLine(“—————–“)
WcnInfoFile.WriteLine(“”)
WcnInfoFile.Close

Set objShell = WScript.CreateObject( “WScript.Shell” )

cmd = “cmd /c sc query wcncsvc >> ” & outputFileName
objShell.Run cmd, 0, True

cmd = “cmd /c sc query wlansvc >> ” & outputFileName
objShell.Run cmd, 0, True

cmd = “cmd /c sc query eaphost >> ” & outputFileName
objShell.Run cmd, 0, True

cmd = “cmd /c sc query fdrespub >> ” & outputFileName
objShell.Run cmd, 0, True

cmd = “cmd /c sc query upnphost >> ” & outputFileName
objShell.Run cmd, 0, True

cmd = “cmd /c sc query eaphost >> ” & outputFileName
objShell.Run cmd, 0, True

Set WcnInfoFile= FSO.OpenTextFile(outputFileName, 8, True)
WcnInfoFile.WriteLine(“”)
WcnInfoFile.WriteLine(“”)
WcnInfoFile.WriteLine(“———————–“)
WcnInfoFile.WriteLine(“+ WCN Files Information “)
WcnInfoFile.WriteLine(“———————–“)
WcnInfoFile.WriteLine(“”)

strComputer = “.”

Set shell = WScript.CreateObject( “WScript.Shell” )
windir = shell.ExpandEnvironmentStrings(“%windir%\system32\”)

Set objWMIService = GetObject(“winmgmts:\” & strComputer & “\root\cimv2”)

Dim FileSet
FileSet = Array(“wcncsvc.dll”, “wcnapi.dll”, “fdwcn.dll”, “wcneapauthproxy.dll”, “wcneappeerproxy.dll”, “wcnwiz.dll”, “wcnnetsh.dll”, “wczdlg.dll”)

For Each file in FileSet
filename = windir + file
strQuery = “Select * from CIM_Datafile Where Name = ‘” + Replace(filename, “\”, “\”) + “‘”
Set fileProp = objWMIService.ExecQuery _
(strQuery)

For Each objFile in fileProp
WcnInfoFile.WriteLine(“”)
WcnInfoFile.WriteLine(“———————“)
WcnInfoFile.WriteLine(file)
WcnInfoFile.WriteLine(“———————“)
WcnInfoFile.WriteLine(” – Version : ” + objFile.Version )
WcnInfoFile.WriteLine(” – Creation Date : ” + objFile.CreationDate )
WcnInfoFile.WriteLine(” – Description : ” + objFile.Description )
WcnInfoFile.WriteLine(” – Installation Date : ” + objFile.InstallDate )
WcnInfoFile.WriteLine(” – In Use Count : ” + objFile.InUseCount )
WcnInfoFile.WriteLine(” – Last Accessed : ” + objFile.LastAccessed )
WcnInfoFile.WriteLine(” – Last Modified : ” + objFile.LastModified )
WcnInfoFile.WriteLine(” – Status : ” + objFile.Status )
Next
Next

WcnInfoFile.WriteLine(“”)
WcnInfoFile.WriteLine(“”)
WcnInfoFile.WriteLine(“——————————-“)
WcnInfoFile.WriteLine(“+ Network Adapters Information “)
WcnInfoFile.WriteLine(“——————————-“)
WcnInfoFile.WriteLine(“”)

strQuery = “Select * from Win32_NetworkAdapter ”

Set AdapterProp = objWMIService.ExecQuery _
(strQuery)

For Each objFile in AdapterProp
WcnInfoFile.WriteLine(“”)
WcnInfoFile.WriteLine(“———————“)
WcnInfoFile.WriteLine(“DeviceID : ” + objFile.DeviceID )
WcnInfoFile.WriteLine(“———————“)
WcnInfoFile.WriteLine(” – Adapter Type : ” + objFile.AdapterType )
WcnInfoFile.WriteLine(” – Auto Sense : ” + objFile.AutoSense )
WcnInfoFile.WriteLine(” – Description : ” + objFile.Description )
WcnInfoFile.WriteLine(” – NetConnectionID : ” + objFile.NetConnectionID )
WcnInfoFile.WriteLine(” – GUID : ” + objFile.GUID )
WcnInfoFile.WriteLine(” – MACAddress : ” + objFile.MACAddress )
WcnInfoFile.WriteLine(” – Manufacturer : ” + objFile.Manufacturer )
WcnInfoFile.WriteLine(” – MaxSpeed : ” + objFile.MaxSpeed )
WcnInfoFile.WriteLine(” – Speed : ” + objFile.Speed )
WcnInfoFile.WriteLine(” – Name : ” + objFile.Name )

Select Case objFile.NetConnectionStatus
Case 0 strAvail= “Disconnected”
Case 1 strAvail= “Connecting”
Case 2 strAvail= “Connected”
Case 3 strAvail= “Disconnecting”
Case 4 strAvail= “Hardware not present”
Case 5 strAvail= “Hardware disabled”
Case 6 strAvail= “Hardware malfunction”
Case 7 strAvail= “Media disconnected”
Case 8 strAvail= “Authenticating”
Case 9 strAvail= “Authentication succeeded”
Case 10 strAvail= “Authentication failed”
Case 11 strAvail= “Invalid address”
Case 12 strAvail= “Credentials required”
End Select

WcnInfoFile.WriteLine(” – NetConnectionStatus : ” + strAvail )
WcnInfoFile.WriteLine(” – NetEnabled : ” + objFile.NetEnabled )
WcnInfoFile.WriteLine(” – NetworkAddresses : ” + objFile.NetworkAddresses )
WcnInfoFile.WriteLine(” – PermanentAddress : ” + objFile.PermanentAddress )
WcnInfoFile.WriteLine(” – PhysicalAdapter : ” + objFile.PhysicalAdapter )
WcnInfoFile.WriteLine(” – PNPDeviceID : ” + objFile.PNPDeviceID )
WcnInfoFile.WriteLine(” – ProductName : ” + objFile.ProductName )
WcnInfoFile.WriteLine(” – ServiceName : ” + objFile.ServiceName )

WcnInfoFile.WriteLine(” – SystemName : ” + objFile.SystemName )
WcnInfoFile.WriteLine(” – TimeOfLastReset : ” + objFile.TimeOfLastReset )
WcnInfoFile.WriteLine(” – Status : ” + objFile.Status )

Select Case objFile.StatusInfo
Case 1 strAvail= “Other”
Case 2 strAvail= “Unknown”
Case 3 strAvail= “Enabled”
Case 4 strAvail= “Disabled”
Case 5 strAvail= “Not Applicable”
End Select

WcnInfoFile.WriteLine(” – StatusInfo : ” + strAvail )

Select Case objFile.Availability
Case 1 strAvail= “Other”
Case 2 strAvail= “Unknown”
Case 3 strAvail= “Running or Full Power”
Case 4 strAvail= “Warning”
Case 5 strAvail= “In test”
Case 6 strAvail= “Not Applicable”
Case 7 strAvail= “Power Off”
Case 8 strAvail= “Off Line”
Case 9 strAvail= “Off Duty”
Case 10 strAvail= “Degraded”
Case 11 strAvail= “Not Installed”
Case 12 strAvail= “Install Error”
Case 13 strAvail= “Power Save – Unknown”
Case 14 strAvail= “Power Save – Low Power Mode”
Case 15 strAvail= “Power Save – Standby”
Case 16 strAvail= “Power Cycle”
Case 17 strAvail= “Power Save – Warning”
End Select

WcnInfoFile.WriteLine(” – Availability : ” + strAvail )
WcnInfoFile.WriteLine(” – Caption : ” + objFile.Caption )

Select Case objFile.ConfigManagerErrorCode
Case 0 strAvail= “Device is working properly”
Case 1 strAvail= “Device is not configured correctly”
Case 2 strAvail= “Windows cannot load the driver for this device”
Case 3 strAvail= “Driver for this device might be corrupted, or the system may be low on memory or other resources”
Case 4 strAvail= “Device is not working properly. One of its drivers or the registry might be corrupted.”
Case 5 strAvail= “Driver for the device requires a resource that Windows cannot manage.”
Case 6 strAvail= “Boot configuration for the device conflicts with other devices”
Case 7 strAvail= “Cannot filter”
Case 8 strAvail= “Driver loader for the device is missing”
Case 9 strAvail= “Device is not working properly. The controlling firmware is incorrectly reporting the resources for the device”
Case 10 strAvail= “Device cannot start”
Case 11 strAvail= “Device failed”
Case 12 strAvail= “Device cannot find enough free resources to use”
Case 13 strAvail= “Windows cannot verify the device’s resources”
Case 14 strAvail= “Device cannot work properly until the computer is restarted”
Case 15 strAvail= “Device is not working properly due to a possible re-enumeration problem”
Case 16 strAvail= “Windows cannot identify all of the resources that the device uses”
Case 17 strAvail= “Device is requesting an unknown resource type.”
Case 18 strAvail= “Device drivers must be reinstalled”
Case 19 strAvail= “Failure using the VxD loader”
Case 20 strAvail= “Registry might be corrupted.”
Case 21 strAvail= “System failure. If changing the device driver is ineffective, see the hardware documentation. Windows is removing the device”
Case 22 strAvail= “Device is disabled”
Case 23 strAvail= “System failure. If changing the device driver is ineffective, see the hardware documentation”
Case 24 strAvail= “Device is not present, not working properly, or does not have all of its drivers installed.”
Case 25 strAvail= “Windows is still setting up the device”
Case 27 strAvail= “Device does not have valid log configuration.”
Case 28 strAvail= “Device drivers are not installed.”
Case 29 strAvail= “Device is disabled. The device firmware did not provide the required resources.”
Case 30 strAvail= “Device is using an IRQ resource that another device is using.”
Case 31 strAvail= “Device is not working properly. Windows cannot load the required device drivers.”
End Select

WcnInfoFile.WriteLine(” – ConfigManagerErrorCode: ” + strAvail )
WcnInfoFile.WriteLine(” – Error Cleared : ” + objFile.ErrorCleared )
WcnInfoFile.WriteLine(” – Error Description : ” + objFile.ErrorDescription)
WcnInfoFile.WriteLine(” – LastErrorCode : ” + objFile.LastErrorCode)
WcnInfoFile.WriteLine(” – Index : ” + objFile.Index)
WcnInfoFile.WriteLine(” – Installed : ” + objFile.Installed )
WcnInfoFile.WriteLine(” – Install Date : ” + objFile.InstallDate )
WcnInfoFile.WriteLine(” – InterfaceIndex : ” + objFile.InterfaceIndex )
Next
WcnInfoFile.Close

Set WcnInfoFile = FSO.OpenTextFile(outputFileName, 8, True)
WcnInfoFile.WriteLine(“”)
WcnInfoFile.WriteLine(“———————–“)
WcnInfoFile.WriteLine(“+ ipconfig information”)
WcnInfoFile.WriteLine(“———————–“)
WcnInfoFile.WriteLine(“”)
WcnInfoFile.Close

cmd = “cmd /c ipconfig /all >> ” & outputFileName
objShell.Run cmd, 0, True

Set WcnInfoFile = FSO.OpenTextFile(outputFileName, 8, True)
WcnInfoFile.WriteLine(“”)
WcnInfoFile.WriteLine(“———————-“)
WcnInfoFile.WriteLine(“+ Softap Capabilities “)
WcnInfoFile.WriteLine(“———————-“)
WcnInfoFile.WriteLine(“”)
WcnInfoFile.Close

cmd = “cmd /c netsh wlan show device >> ” & outputFileName
objShell.Run cmd, 0, True

Set WcnInfoFile = FSO.OpenTextFile(outputFileName, 8, True)
WcnInfoFile.WriteLine(“”)
WcnInfoFile.WriteLine(“———————-“)
WcnInfoFile.WriteLine(“+ Dump wcncsvc RegKey “)
WcnInfoFile.WriteLine(“———————-“)
WcnInfoFile.WriteLine(“”)
WcnInfoFile.Close

cmd = “cmd /c reg query HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\wcncsvc\Parameters >> ” & outputFileName
objShell.Run cmd, 0, True

‘ Set shell = WScript.CreateObject( “WScript.Shell” )
‘ windir = shell.ExpandEnvironmentStrings(“%windir%\system32\”)
‘ filename = windir + “wcnwiz.dll”
‘ commandname = windir + “rundll32.exe”

‘ cmd = “cmd /c “& commandname &” “& filename &” , RunDumpWcnCache >> ” & outputFileName
‘ objShell.Run cmd, 0, True

Set WcnInfoFile = FSO.OpenTextFile(outputFileName, 8, True)
WcnInfoFile.WriteLine(“”)
WcnInfoFile.WriteLine(“——————————–“)
WcnInfoFile.WriteLine(“+ Network Discovery Information.”)
WcnInfoFile.WriteLine(“——————————–“)
WcnInfoFile.WriteLine(“”)
WcnInfoFile.WriteLine(“”)
WcnInfoFile.WriteLine(“——————————“)
WcnInfoFile.WriteLine(“- Current Profile information”)
WcnInfoFile.WriteLine(“——————————“)
WcnInfoFile.WriteLine(“”)

‘ Profile Type
Const NET_FW_PROFILE2_DOMAIN = 1
Const NET_FW_PROFILE2_PRIVATE = 2
Const NET_FW_PROFILE2_PUBLIC = 4

‘ Direction
Const NET_FW_RULE_DIR_IN = 1
Const NET_FW_RULE_DIR_OUT = 2

‘ Create the FwPolicy2 object.
Dim fwPolicy2
Dim ProfileType
ProfileType = Array(“Domain”, “Private”, “Public”)

Set fwPolicy2 = CreateObject(“HNetCfg.FwPolicy2”)

CurrentProfile = fwPolicy2.CurrentProfileTypes

WcnInfoFile.WriteLine (“Current firewall profile is: “)

‘// The returned ‘CurrentProfiles’ bitmask can have more than 1 bit set if multiple profiles
‘// are active or current at the same time

if ( CurrentProfile AND NET_FW_PROFILE2_DOMAIN ) then
WcnInfoFile.WriteLine(ProfileType(0))
end if

if ( CurrentProfile AND NET_FW_PROFILE2_PRIVATE ) then
WcnInfoFile.WriteLine(ProfileType(1))
end if

if ( CurrentProfile AND NET_FW_PROFILE2_PUBLIC ) then
WcnInfoFile.WriteLine(ProfileType(2))
end if
WcnInfoFile.Close

cmd = “cmd /c netsh advfirewall show currentprofile >> ” & outputFileName
objShell.Run cmd, 0, True

Set WcnInfoFile = FSO.OpenTextFile(outputFileName, 8, True)
WcnInfoFile.WriteLine(“”)
WcnInfoFile.WriteLine(“———————————————-“)
WcnInfoFile.WriteLine(“- Network discovery status for current profile”)
WcnInfoFile.WriteLine(“———————————————-“)
WcnInfoFile.WriteLine(“”)

Dim rule
‘ Get the Rules object
Dim RulesObject
Set RulesObject = fwPolicy2.Rules

For Each rule In Rulesobject
if rule.Grouping = “@FirewallAPI.dll,-32752” then
WcnInfoFile.WriteLine(“”)
WcnInfoFile.WriteLine(” Rule Name: ” & rule.Name)
WcnInfoFile.WriteLine(” ———————————————-“)
WcnInfoFile.WriteLine(” Enabled: ” & rule.Enabled)
WcnInfoFile.WriteLine(” Description: ” & rule.Description)
WcnInfoFile.WriteLine(” Application Name: ” & rule.ApplicationName)
WcnInfoFile.WriteLine(” Service Name: ” & rule.ServiceName)

Select Case rule.Direction
Case NET_FW_RULE_DIR_IN WcnInfoFile.WriteLine(” Direction: In”)
Case NET_FW_RULE_DIR_OUT WcnInfoFile.WriteLine(” Direction: Out”)
End Select

end if
Next

WcnInfoFile.Close

End Sub

Sub GetWirelessAdapterInfo(outputFile)
On Error Resume Next
Dim adapters, objReg
Dim adapterDetailNames, adapterDetailRegValNames

adapterDetailNames = Array(“Driver Description”, “Adapter Guid”, “Hardware ID”, “Driver Date”, “Driver Version”, “Driver Provider”)
adapterDetailRegValNames = Array(“DriverDesc”, “NetCfgInstanceId”, “MatchingDeviceId”, “DriverDate”, “DriverVersion”, “ProviderName”)

IHVDetailNames = Array(“ExtensibilityDLL”, “UIExtensibilityCLSID”, “GroupName”, “DiagnosticsID”)
IHVDetailRegValNames = Array(“ExtensibilityDLL”, “UIExtensibilityCLSID”, “GroupName”, “DiagnosticsID”)

HKEY_LOCAL_MACHINE = &H80000002
strComputer = “.”

Set objReg = GetObject(“winmgmts:{impersonationLevel=impersonate}!\” &_
strComputer & “\root\default:StdRegProv”)

strKeyPath = “SYSTEM\CurrentControlSet\Control\Class{4D36E972-E325-11CE-BFC1-08002BE10318}\”

objReg.EnumKey HKEY_LOCAL_MACHINE, strKeyPath, adapterSet

For Each adapter In adapterSet
If StrComp(“Properties”, adapter) Then
fullstrKeyPath = strKeyPath + adapter
objReg.GetDWORDValue HKEY_LOCAL_MACHINE, fullstrKeyPath, “*IfType”, ifType
If ifType = 71 Then
for I = 0 to UBound(adapterDetailNames)
objReg.GetStringValue HKEY_LOCAL_MACHINE, fullstrKeyPath, adapterDetailRegValNames(I), info
outputFile.WriteLine(adapterDetailNames(I) + ” = ” + info)
Next

ihvKeyPath = fullstrKeyPath + “\Ndi\IHVExtensions”
For J = 0 to UBound(IHVDetailNames)
objReg.GetStringValue HKEY_LOCAL_MACHINE, ihvKeyPath, IHVDetailRegValNames(J), ihvInfo
outputFile.WriteLine(IHVDetailNames(J) + ” = ” + ihvInfo)
Next
objReg.GetDWordValue HKEY_LOCAL_MACHINE, ihvKeyPath, “AdapterOUI”, ihvInfo
outputFile.WriteLine(“AdapterOUI = ” + CSTR(ihvInfo))
outputFile.WriteLine()
End If
End If
Next

Set objShell = WScript.CreateObject( “WScript.Shell” )

processes = “processes.txt”
cmd = “cmd /c tasklist /svc > ” & processes
objShell.Run cmd, 0, True

Set objTextFile = FSO.OpenTextFile(processes, 1)
strIHVOutput = objTextFile.ReadAll()

Set regEx = New RegExp
regEx.Pattern = “^wlanext.exe[\s|a-z|A-Z|\d]*”
regEx.Multiline = True
regEx.IgnoreCase = True
regEx.Global = True

Set Matches = regEx.Execute(strIHVOutput)

For Each match in Matches
outputFile.WriteLine(match.Value)
Next

End Sub

Sub GetWirelessAutoconfigLog(logFileName)
On Error Resume Next

Set objShell = WScript.CreateObject( “WScript.Shell” )

‘Export the operational log
cmd = “cmd /c wevtutil epl “”Microsoft-Windows-WLAN-AutoConfig/Operational”” ” & logFileName
objShell.Run cmd, 0, True

‘Archive the log so that it can be read on different machines
cmd = “cmd /c wevtutil al ” & logFileName
objShell.Run cmd, 0, True
End Sub

Sub GetWwanLog(logFileName)
On Error Resume Next

Set objShell = WScript.CreateObject( “WScript.Shell” )

‘Export the operational log
cmd = “cmd /c wevtutil epl “”Microsoft-Windows-WWAN-SVC-EVENTS/Operational”” ” & logFileName
objShell.Run cmd, 0, True

‘Archive the log so that it can be read on different machines
cmd = “cmd /c wevtutil al ” & logFileName
objShell.Run cmd, 0, True
End Sub

Sub GetWcmLog(logFileName)
On Error Resume Next

Set objShell = WScript.CreateObject( “WScript.Shell” )

‘Export the operational log
cmd = “cmd /c wevtutil epl “”Microsoft-Windows-Wcmsvc/Operational”” ” & logFileName
objShell.Run cmd, 0, True

‘Archive the log so that it can be read on different machines
cmd = “cmd /c wevtutil al ” & logFileName
objShell.Run cmd, 0, True
End Sub

Sub GetWiredAdapterInfo(outputFile)
On Error Resume Next
Dim adapters, objReg
Dim adapterDetailNames, adapterDetailRegValNames

adapterDetailNames = Array(“Driver Description”, “Adapter Guid”, “Hardware ID”, “Driver Date”, “Driver Version”, “Driver Provider”)
adapterDetailRegValNames = Array(“DriverDesc”, “NetCfgInstanceId”, “MatchingDeviceId”, “DriverDate”, “DriverVersion”, “ProviderName”)

HKEY_LOCAL_MACHINE = &H80000002
strComputer = “.”

Set objReg = GetObject(“winmgmts:{impersonationLevel=impersonate}!\” &_
strComputer & “\root\default:StdRegProv”)

strKeyPath = “SYSTEM\CurrentControlSet\Control\Class{4D36E972-E325-11CE-BFC1-08002BE10318}\”

objReg.EnumKey HKEY_LOCAL_MACHINE, strKeyPath, adapterSet

For Each adapter In adapterSet
If StrComp(“Properties”, adapter) Then
fullstrKeyPath = strKeyPath + adapter
objReg.GetDWORDValue HKEY_LOCAL_MACHINE, fullstrKeyPath, “*IfType”, ifType
If ifType = 6 Then
for I = 0 to UBound(adapterDetailNames)
objReg.GetStringValue HKEY_LOCAL_MACHINE, fullstrKeyPath, adapterDetailRegValNames(I), info
outputFile.WriteLine(adapterDetailNames(I) + ” = ” + info)
Next
outputFile.WriteLine()
End If
End If
Next
End Sub

Sub GetEnvironmentInfo(outputFileName)
On Error Resume Next
Dim envInfoFile

Set objShell = WScript.CreateObject( “WScript.Shell” )

cmd = “cmd /c netsh wlan show all > ” & outputFileName
objShell.Run cmd, 0, True

cmd = “cmd /c netsh lan show interfaces >> ” & outputFileName
objShell.Run cmd, 0, True

cmd = “cmd /c netsh lan show settings >> ” & outputFileName
objShell.Run cmd, 0, True

cmd = “cmd /c netsh lan show profiles >> ” & outputFileName
objShell.Run cmd, 0, True

cmd = “cmd /c netsh mbn show interfaces >> ” & outputFileName
objShell.Run cmd, 0, True

cmd = “cmd /c netsh mbn show profile name=* interface=* >> ” & outputFileName
objShell.Run cmd, 0, True

cmd = “cmd /c netsh mbn show readyinfo interface=* >> ” & outputFileName
objShell.Run cmd, 0, True

cmd = “cmd /c netsh mbn show capability interface=* >> ” & outputFileName
objShell.Run cmd, 0, True

cmd = “cmd /c ipconfig /all >> ” & outputFileName
objShell.Run cmd, 0, True

RunCmd “echo.”, outputFileName
RunCmd “echo ROUTE PRINT:”, outputFileName
RunCmd “route print”, outputFileName

Set envInfoFile = FSO.OpenTextFile(outputFileName, 8, True)
envInfoFile.WriteLine(“”)
envInfoFile.WriteLine(“Machine certificates…”)
envInfoFile.WriteLine(“”)
envInfoFile.Close

cmd = “cmd /c certutil -v -store -silent My >> ” & outputFileName
objShell.Run cmd, 0, True

Set envInfoFile = FSO.OpenTextFile(outputFileName, 8, True)
envInfoFile.WriteLine(“”)
envInfoFile.WriteLine(“User certificates…”)
envInfoFile.WriteLine(“”)
envInfoFile.Close

cmd = “cmd /c certutil -v -store -silent -user My >> ” & outputFileName
objShell.Run cmd, 0, True

Set envInfoFile = FSO.OpenTextFile(outputFileName, 8, True)
envInfoFile.WriteLine(“”)
envInfoFile.WriteLine(“Root certificates (machine store)…”)
envInfoFile.WriteLine(“”)
envInfoFile.Close

cmd = “cmd /c certutil -v -store -silent root >> ” & outputFileName
objShell.Run cmd, 0, True

Set envInfoFile = FSO.OpenTextFile(outputFileName, 8, True)
envInfoFile.WriteLine(“”)
envInfoFile.WriteLine(“Root certificates (enterprise store)…”)
envInfoFile.WriteLine(“”)
envInfoFile.Close

cmd = “cmd /c certutil -v -enterprise -store -silent NTAuth >> ” & outputFileName
objShell.Run cmd, 0, True

Set envInfoFile = FSO.OpenTextFile(outputFileName, 8, True)
envInfoFile.WriteLine(“”)
envInfoFile.WriteLine(“Root certificates (user store)…”)
envInfoFile.WriteLine(“”)
envInfoFile.Close

cmd = “cmd /c certutil -v -user -store -silent root >> ” & outputFileName
objShell.Run cmd, 0, True
End Sub

‘Comments: Function to dump a tree under a registry path into a file
Sub DumpRegKey(outputFileName,regpath)
On Error Resume Next
Dim cmd

Set objShell = WScript.CreateObject( “WScript.Shell” )

cmd = “cmd /c reg export ” & regpath & ” ” & outputFileName & ” /y”
objShell.Run cmd, 0, True

End Sub

Sub DumpAllKeys
On Error Resume Next
Dim NotifRegFile, RegFolder, Key

RegFolder = “Reg”

if Not FSO.FolderExists(RegFolder) Then
FSO.CreateFolder RegFolder
End If

‘ Dump WLAN registry keys
AllCredRegFile = RegFolder + “\AllCred.reg.txt”
AllCredFilterFile = RegFolder + “\AllCredFilter.reg.txt”
CredRegFileA = RegFolder + “{07AA0886-CC8D-4e19-A410-1C75AF686E62}.reg.txt”
CredRegFileB = RegFolder + “{33c86cd6-705f-4ba1-9adb-67070b837775}.reg.txt”
CredRegFileC = RegFolder + “{edd749de-2ef1-4a80-98d1-81f20e6df58e}.reg.txt”
APIPermRegFile = RegFolder + “\APIPerm.reg.txt”
NotifRegFile = RegFolder + “\Notif.reg.txt”
GPTRegFile = RegFolder + “\GPT.reg.txt”
CUWlanSvcRegFile = RegFolder + “\HKCUWlanSvc.reg.txt”
LMWlanSvcRegFile = RegFolder + “\HKLMWlanSvc.reg.txt”
NidRegFile = RegFolder + “\NetworkProfiles.reg.txt”

call DumpRegKey(NotifRegFile ,”””HKLM\SYSTEM\CurrentControlSet\Control\Winlogon\Notifications”””)
call DumpRegKey(AllCredRegFile ,”””HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Authentication\Credential Providers”””)
call DumpRegKey(AllCredFilterFile,”””HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Authentication\Credential Provider Filters”””)
call DumpRegKey(CredRegFileA ,”””HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Authentication\Credential Providers{07AA0886-CC8D-4e19-A410-1C75AF686E62}”””)
call DumpRegKey(CredRegFileB ,”””HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Authentication\Credential Providers{33c86cd6-705f-4ba1-9adb-67070b837775}”””)
call DumpRegKey(CredRegFileC ,”””HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Authentication\Credential Provider Filters{edd749de-2ef1-4a80-98d1-81f20e6df58e}”””)
call DumpRegKey(APIPermRegFile ,”””HKLM\SYSTEM\CurrentControlSet\Services\Wlansvc\Parameters\WlanAPIPermissions”””)

call DumpRegKey(GPTRegFile , “””HKLM\SOFTWARE\Policies\Microsoft\Windows\Wireless\GPTWirelessPolicy”””)
call DumpRegKey(CUWlanSvcRegFile ,”””HKCU\SOFTWARE\Microsoft\Wlansvc”””)
call DumpRegKey(LMWlanSvcRegFile ,”””HKLM\SOFTWARE\Microsoft\Wlansvc”””)

‘ Dump Dot3 registry keys
LMDot3SvcRegFile = RegFolder + “\HKLMDot3Svc.reg.txt”
CUDot3SvcRegFile = RegFolder + “\HKCUDot3Svc.reg.txt”
LGPPolicyFile = RegFolder + “\L2GP.reg.txt”

call DumpRegKey(LMDot3SvcRegFile ,”””HKLM\SOFTWARE\Microsoft\dot3svc”””)
call DumpRegKey(CUDot3SvcRegFile ,”””HKCU\SOFTWARE\Microsoft\dot3svc”””)
call DumpRegKey(LGPPolicyFile ,”””HKLM\SOFTWARE\Policies\Microsoft\Windows\WiredL2\GP_Policy”””)

call DumpRegKey(NidRegFile ,”””HKLM\SOFTWARE\MICROSOFT\Windows NT\CurrentVersion\NetworkList”””)

‘ Dump WCM registry keys
WCMPolicyRegFile = RegFolder + “\WCMPolicy.reg.txt”
call DumpRegKey(WCMPolicyRegFile ,”””HKLM\SOFTWARE\Policies\Microsoft\WcmSvc”””)

End Sub

‘ Dump Winsock LSP catalog
Sub DumpWinsockCatalog(outputFileName)
On Error Resume Next
Dim envInfoFile

Set objShell = WScript.CreateObject( “WScript.Shell” )

cmd = “cmd /c netsh winsock show catalog > ” & outputFileName
objShell.Run cmd, 0, True
End Sub

‘ Dump the Windows Firewall Configuration
Sub GetWindowsFirewallInfo(configFileName, logFileName, effectiveRulesFileName, consecLogFileName, logFileNameVerbose, consecLogFileNameVerbose)
On Error Resume Next
Dim envInfoFile

Set objShell = WScript.CreateObject( “WScript.Shell” )

cmd = “cmd /c echo Current Profiles: > ” & configFileName
objShell.Run cmd, 0, True
cmd = “cmd /c echo ———————————————————————— >> ” & configFileName
objShell.Run cmd, 0, True

‘Dump the current profiles
cmd = “cmd /c netsh advfirewall monitor show currentprofile >> ” & configFileName
objShell.Run cmd, 0, True

cmd = “cmd /c echo Firewall Configuration: >> ” & configFileName
objShell.Run cmd, 0, True
cmd = “cmd /c echo ———————————————————————— >> ” & configFileName
objShell.Run cmd, 0, True

‘ Dump the firewall configuration
cmd = “cmd /c netsh advfirewall monitor show firewall >> ” & configFileName
objShell.Run cmd, 0, True

cmd = “cmd /c echo Connection Security Configuration: >> ” & configFileName
objShell.Run cmd, 0, True
cmd = “cmd /c echo ———————————————————————— >> ” & configFileName
objShell.Run cmd, 0, True

‘Dump the connection security configuration
cmd = “cmd /c netsh advfirewall monitor show consec >> ” & configFileName
objShell.Run cmd, 0, True

cmd = “cmd /c echo Firewall Rules : >> ” & configFileName
objShell.Run cmd, 0, True
cmd = “cmd /c echo ———————————————————————— >> ” & configFileName
objShell.Run cmd, 0, True

‘Dump the firewall rules
cmd = “cmd /c netsh advfirewall firewall show rule name=all verbose >> ” & configFileName
objShell.Run cmd, 0, True

cmd = “cmd /c echo Connection Security Rules : >> ” & configFileName
objShell.Run cmd, 0, True
cmd = “cmd /c echo ———————————————————————— >> ” & configFileName
objShell.Run cmd, 0, True

‘Dump the connection security rules
cmd = “cmd /c netsh advfirewall consec show rule name=all verbose >> ” & configFileName
objShell.Run cmd, 0, True

‘Dump the firewall rules from Dynamic Store

cmd = “cmd /c echo Firewall Rules currently enforced : > ” & effectiveRulesFileName
objShell.Run cmd, 0, True
cmd = “cmd /c echo ———————————————————————— >> ” & effectiveRulesFileName
objShell.Run cmd, 0, True

cmd = “cmd /c netsh advfirewall monitor show firewall rule name=all >> ” & effectiveRulesFileName
objShell.Run cmd, 0, True

‘Dump the connection security rules from Dynamic Store

cmd = “cmd /c echo Connection Security Rules currently enforced : >> ” & effectiveRulesFileName
objShell.Run cmd, 0, True
cmd = “cmd /c echo ———————————————————————— >> ” & effectiveRulesFileName
objShell.Run cmd, 0, True

cmd = “cmd /c netsh advfirewall monitor show consec rule name=all >> ” & effectiveRulesFileName
objShell.Run cmd, 0, True

‘Export the operational log
cmd = “cmd /c wevtutil epl “”Microsoft-Windows-Windows Firewall With Advanced Security/Firewall”” ” & logFileName
objShell.Run cmd, 0, True

‘Archive the log so that it could be read on different machines
cmd = “cmd /c wevtutil al ” & logFileName
objShell.Run cmd, 0, True

‘Export the operational log
cmd = “cmd /c wevtutil epl “”Microsoft-Windows-Windows Firewall With Advanced Security/ConnectionSecurity”” ” & consecLogFileName
objShell.Run cmd, 0, True

‘Archive the log so that it could be read on different machines
cmd = “cmd /c wevtutil al ” & consecLogFileName
objShell.Run cmd, 0, True

‘Export the operational log
cmd = “cmd /c wevtutil epl “”Microsoft-Windows-Windows Firewall With Advanced Security/FirewallVerbose”” ” & logFileNameVerbose
objShell.Run cmd, 0, True

‘Archive the log so that it could be read on different machines
cmd = “cmd /c wevtutil al ” & logFileNameVerbose
objShell.Run cmd, 0, True

‘Export the operational log
cmd = “cmd /c wevtutil epl “”Microsoft-Windows-Windows Firewall With Advanced Security/ConnectionSecurityVerbose”” ” & consecLogFileNameVerbose
objShell.Run cmd, 0, True

‘Archive the log so that it could be read on different machines
cmd = “cmd /c wevtutil al ” & consecLogFileNameVerbose
objShell.Run cmd, 0, True

End Sub

Sub GetWfpInfo(outputFileName, logFileName)
On Error Resume Next

Set objShell = WScript.CreateObject( “WScript.Shell” )

cmd = “cmd /c netsh wfp show filters file=” & outputFileName & ” > ” & logFileName
objShell.Run cmd, 0, True

End Sub

‘ Dump Netio State
Sub GetNetioInfo(outputFileName)
On Error Resume Next

Set objShell = WScript.CreateObject( “WScript.Shell” )

cmd = “cmd /c netsh interface teredo show state > ” & outputFileName
objShell.Run cmd, 0, True

cmd = “cmd /c netsh interface httpstunnel show interface >> ” & outputFileName
objShell.Run cmd, 0, True

cmd = “cmd /c netsh interface httpstunnel show statistics >> ” & outputFileName
objShell.Run cmd, 0, True

End Sub

Sub GetDnsInfo(logFileName)
On Error Resume Next

Set objShell = WScript.CreateObject( “WScript.Shell” )

RunCmd “echo IPCONFIG /DISPLAYDNS: “, logFileName
RunCmd “ipconfig /displaydns”, logFileName

RunCmd “echo. “, logFileName
RunCmd “echo NETSH NAMESPACE SHOW EFFECTIVE:”, logFileName
RunCmd “netsh namespace show effective”, logFileName

RunCmd “echo.”, logFileName
RunCmd “echo NETSH NAMESPACE SHOW POLICY:”, logFileName
RunCmd “netsh namespace show policy”, logFileName

End Sub

Sub GetNeighborInfo(logFileName)
On Error Resume Next

Set objShell = WScript.CreateObject( “WScript.Shell” )

RunCmd “echo ARP -A:”, logFileName
RunCmd “arp -a”, logFileName

RunCmd “echo.”, logFileName
RunCmd “echo NETSH INT IPV6 SHOW NEIGHBORS:”, logFileName
RunCmd “netsh int ipv6 show neigh”, logFileName

End Sub

Sub GetFileSharingInfo(logFileName)
On Error Resume Next

Set objShell = WScript.CreateObject( “WScript.Shell” )

RunCmd “echo NBTSTAT -N:”, logFileName
RunCmd “nbtstat -n”, logFileName

RunCmd “echo.”, logFileName
RunCmd “echo NBTSTAT -C:”, logFileName
RunCmd “nbtstat -c”, logFileName

RunCmd “echo.”, logFileName
RunCmd “echo NET CONFIG RDR:”, logFileName
RunCmd “net config rdr”, logFileName

‘ Run the following 2 commands only if lanmanserver service is running
‘ In WOA build, FileSharing is disabled – hence this results in a prompt
‘ which halts the script at that point and netsh trace stop can go on indefinitely

strComputer = “.”
Set objWmiService = GetObject(“winmgmts:\” & strComputer & “\root\cimv2”)
strQuery = “Select * from WIN32_Service where Name = ‘lanmanserver’ AND Started = True”
Set objService = objWmiService.ExecQuery (strQuery)

RunCmd “echo.”, logFileName
RunCmd “echo NET CONFIG SRV:”, logFileName

If objService.Count = 1 Then
RunCmd “net config srv”, logFileName
Else
RunCmd “echo The Server service is not running.”, logFileName
End If

RunCmd “echo.”, logFileName
RunCmd “echo NET SHARE:”, logFileName

If objService.Count = 1 Then
RunCmd “net share”, logFileName
Else
RunCmd “echo The Server service is not running.”, logFileName
End If

End Sub

Sub GetGPResultInfo(logFileName)
On Error Resume Next

Set objShell = WScript.CreateObject( “WScript.Shell” )

cmd = “cmd /c gpresult /scope:computer /v 1> ” & logFileName & ” 2>&1″
objShell.Run cmd, 0, False

End Sub

Sub GetNetEventsInfo(outputFileName, logFileName)
On Error Resume Next

Set objShell = WScript.CreateObject( “WScript.Shell” )

cmd = “cmd /c netsh wfp show netevents file=” & outputFileName & ” 1> ” & logFileName & ” 2>&1″
objShell.Run cmd, 0, True

End Sub

Sub GetShowStateInfo(outputFileName, logFileName)
On Error Resume Next

Set objShell = WScript.CreateObject( “WScript.Shell” )

cmd = “cmd /c netsh wfp show state file=” & outputFileName & ” 1> ” & logFileName & ” 2>&1″
objShell.Run cmd, 0, True

End Sub

Sub GetSysPortsInfo(outputFileName, logFileName)
On Error Resume Next

Set objShell = WScript.CreateObject( “WScript.Shell” )

cmd = “cmd /c netsh wfp show sysports file=” & outputFileName & ” 1> ” & logFileName & ” 2>&1″
objShell.Run cmd, 0, True

End Sub

‘ Add XML node entry
Sub AddXmlNodeEntry(xmlDoc, entryName, entryValue, parentEntry, entryObject)
On Error Resume Next
Set entryObject = xmlDoc.createElement(entryName)
If (IsNull(entryValue) = False) Then
entryObject.Text = entryValue
End If
parentEntry.appendChild entryObject
End Sub

‘ Dump Vmswitch State
Sub GetVmswitchInfo(outputFileName)
On Error Resume Next

strComputer = “.”
Set objCimService = GetObject(“winmgmts:\” & strComputer & “\root\cimv2”)
onOffState = Array(“On”, “Off”)
reservationMode = Array(“Default”, “Weight”, “Absolute”, “None”)
nicTypeArray = Array(“Synthetic”, “Emulated”, “Internal”, “External”)
extensionTypeArray = Array(“Unknown”, “Capture”, “Filter”, “Forwarding”, “Monitoring”, “Native”)
enabledStatesArray = Array(“Unknown”, “Unknown”, “Enabled”, “Disabled”)
vlanModeArray = Array(“Unknown”,”Access”,”Trunk”,”Private”)
PvlanModeArray = Array(“Unknown”,”Isolated”,”Community”,”Promiscuous”)
monitorModeArray = Array(“None”,”Destination”,”Source”)
aclActionArray = Array(“Unknown”,”Allow”,”Deny”,”Meter”)
aclDirectionArray = Array(“Unknown”,”Inbound”,”Outbound”)
aclApplicabilityArray = Array(“Unknown”,”Local”,”Remote”)
aclTypeArray = Array(“Unknown”,”MAC”,”IPv4″,”IPv6″)
isolationModeArray = Array(“None”,”NativeVirtualSubnet”,”ExternalVirtualSubnet”,”VLAN”)
iovInterruptModerationArray = Array(“Default”, “Adaptive”, “Off”, “Low”, “Medium”, “High”)

strQuery = “Select * from WIN32_Service where Name = ‘vmms’ AND Started = True”
Set objVmmsService = objCimService.ExecQuery (strQuery)
If objVmmsService.Count > 0 Then
Set xmlDoc = CreateObject(“Microsoft.XMLDOM”)
Set objRoot = xmlDoc.createElement(“VmswitchInfo”)
xmlDoc.appendChild objRoot
Set objVirtualizationService = GetObject(“winmgmts:\” & strComputer & “\root\virtualization\v2”)
strQuery = “Select * from MSVM_VirtualEthernetSwitch”
Set switches = objVirtualizationService.ExecQuery (strQuery)
For Each switch in switches
Call AddXmlNodeEntry(xmlDoc, “Switch”, null, objRoot, objSwitch)
Call AddXmlNodeEntry(xmlDoc, “Name”, switch.Name, objSwitch, objSwitchName)
Call AddXmlNodeEntry(xmlDoc, “FriendlyName”, switch.ElementName, objSwitch, objSwitchFriendlyName)
strQuery = “Select * from MSVM_VirtualEthernetSwitchSettingData WHERE VirtualSystemIdentifier='” + switch.Name + “‘”
Set switchSetting = objVirtualizationService.ExecQuery (strQuery).ItemIndex(0)
switchReservationMode = reservationMode(switchSetting.BandwidthReservationMode)
iovPreferred = switchSetting.IOVPreferred

‘ Bandwidth info
Call AddXmlNodeEntry(xmlDoc, “SwitchBandwidth”, null, objSwitch, objBandwidth)
Call AddXmlNodeEntry(xmlDoc, “BandwidthReservationMode”, switchReservationMode, objBandwidth, objSwitchBandwidthReservationMode)
strQuery = “Select * from MSVM_EthernetSwitchBandwidthData WHERE SystemName ='” + switch.Name + “‘”
Set queryResult = objVirtualizationService.ExecQuery (strQuery)
If (queryResult.Count > 0) Then
Set bandwidth = queryResult.ItemIndex(0)
Call AddXmlNodeEntry(xmlDoc, “BandwidthCapacity”, bandwidth.Capacity, objBandwidth, objSwitchBandwidthCapacity)
Call AddXmlNodeEntry(xmlDoc, “DefaultFlowReservation”, bandwidth.DefaultFlowReservation, objBandwidth, objSwitchDefaultFlowReservation)
Call AddXmlNodeEntry(xmlDoc, “DefaultFlowReservationPercentage”, bandwidth.DefaultFlowReservationPercentage, objBandwidth, objSwitchDefaultFlowReservationPercentage)
Call AddXmlNodeEntry(xmlDoc, “DefaultFlowWeight”, bandwidth.DefaultFlowWeight, objBandwidth, objSwitchDefaultFlowWeight)
Call AddXmlNodeEntry(xmlDoc, “Reservation”, bandwidth.Reservation, objBandwidth, objSwitchReservation)
End if

‘ Offload info
Call AddXmlNodeEntry(xmlDoc, “SwitchOffload”, null, objSwitch, objOffload)
Call AddXmlNodeEntry(xmlDoc, “IOVPreferred”, iovPreferred, objOffload, objSwitchIOVPreferred)
strQuery = “Select * from MSVM_EthernetSwitchHardwareOffloadData WHERE SystemName='” + switch.Name + “‘”
Set queryResult = objVirtualizationService.ExecQuery (strQuery)
If (queryResult.Count > 0) Then
Set offload = queryResult.ItemIndex(0)
Call AddXmlNodeEntry(xmlDoc, “IovQueuePairCapacity”, offload.IovQueuePairCapacity, objOffload, objSwitchIovQueuePairCapacity)
Call AddXmlNodeEntry(xmlDoc, “IovQueuePairUsage”, offload.IovQueuePairUsage, objOffload, objSwitchIovQueuePairUsage )
Call AddXmlNodeEntry(xmlDoc, “IovVfCapacity”, offload.IovVfCapacity, objOffload, objSwitchIovVfCapacity)
Call AddXmlNodeEntry(xmlDoc, “IovVfUsage”, offload.IovVfUsage, objOffload, IovVfUsage)
Call AddXmlNodeEntry(xmlDoc, “IPsecSACapacity”, offload.IPsecSACapacity, objOffload, objSwitchIPsecSACapacity)
Call AddXmlNodeEntry(xmlDoc, “IPsecSAUsage”, offload.IPsecSAUsage, objOffload, objSwitchIPsecSAUsage)
End if

‘ Extension info
Call AddXmlNodeEntry(xmlDoc, “SwitchExtensions”, null, objSwitch, objExtensionList)
strQuery = “Select * from MSVM_EthernetSwitchExtension WHERE SystemName='” + switch.Name + “‘”
Set extensionList = objVirtualizationService.ExecQuery (strQuery)
For Each extension In extensionList
Call AddXmlNodeEntry(xmlDoc, “Extension”, null, objExtensionList, objExtension)
Call AddXmlNodeEntry(xmlDoc, “ElementName”, extension.ElementName, objExtension, objExtensionElementName)
Call AddXmlNodeEntry(xmlDoc, “Name”, extension.Name, objExtension, objExtensionName)
Call AddXmlNodeEntry(xmlDoc, “ExtensionType”, extensionTypeArray(extension.ExtensionType), objExtension, objExtensionExtensionType)
Call AddXmlNodeEntry(xmlDoc, “EnabledState”, enabledStatesArray(extension.EnabledState), objExtension, objExtensionEnabledState)
Call AddXmlNodeEntry(xmlDoc, “EnabledDefault”, enabledStatesArray(extension.EnabledDefault), objExtension, objExtensionEnabledDefault)
Call AddXmlNodeEntry(xmlDoc, “Vendor”, extension.Vendor, objExtension, objExtensionVendor)
Call AddXmlNodeEntry(xmlDoc, “Version”, extension.Version, objExtension, objExtensionVersion)
Next

‘ Port info
strQuery = “Select * from MSVM_EthernetSwitchPort WHERE SystemName='” + switch.Name + “‘”
Set switchPort = objVirtualizationService.ExecQuery (strQuery)
For Each port In switchPort
Call AddXmlNodeEntry(xmlDoc, “Port”, null, objSwitch, objPort)
Call AddXmlNodeEntry(xmlDoc, “Name”, port.Name, objPort, objPortName)
Call AddXmlNodeEntry(xmlDoc, “FriendlyName”, port.ElementName, objPort, objPortFriendlyName)

‘Port offload info
Call AddXmlNodeEntry(xmlDoc, “PortOffload”, null, objPort, objPortOffload)
strQuery = “Select * from MSVM_EthernetSwitchPortOffloadData WHERE DeviceID='” + port.Name + “‘”
Set queryResult = objVirtualizationService.ExecQuery (strQuery)
If (queryResult.Count > 0) Then
Set portOffload = queryResult.ItemIndex(0)
Call AddXmlNodeEntry(xmlDoc, “IovOffloadUsage”, portOffload.IovOffloadUsage, objPortOffload, objPortIovOffloadUsage)
Call AddXmlNodeEntry(xmlDoc, “IovQueuePairUsage”, portOffload.IovQueuePairUsage, objPortOffload, objPortIovQueuePairUsage)
Call AddXmlNodeEntry(xmlDoc, “IovVfDataPathActive”, portOffload.IovVfDataPathActive, objPortOffload, objPortIovVfDataPathActive)
Call AddXmlNodeEntry(xmlDoc, “IovVfId”, portOffload.IovVfId, objPortOffload, objPortIovVfId)
Call AddXmlNodeEntry(xmlDoc, “IpsecCurrentOffloadSaCount”, portOffload.IpsecCurrentOffloadSaCount, objPortOffload, objPortIpsecCurrentOffloadSaCount)
Call AddXmlNodeEntry(xmlDoc, “VMQId”, portOffload.VMQId, objPortOffload, objPortVMQId)
Call AddXmlNodeEntry(xmlDoc, “VMQOffloadUsage”, portOffload.VMQOffloadUsage, objPortOffload, objPortVMQOffloadUsage)
End if

‘Port Bandwidth feature status
Call AddXmlNodeEntry(xmlDoc, “PortBandwidth”, null, objPort, objPortBandwidth)
strQuery = “Select * from MSVM_EthernetSwitchPortBandwidthData WHERE DeviceID='” + port.Name + “‘”
Set queryResult = objVirtualizationService.ExecQuery (strQuery)
If (queryResult.Count > 0) Then
Set portBandwidth = queryResult.ItemIndex(0)
Call AddXmlNodeEntry(xmlDoc, “BandwidthReservationPercentage”, portBandwidth.CurrentBandwidthReservationPercentage, objPortBandwidth, objPortCurrentBandwidthReservationPercentage)
End If

‘Get the setting data for the port
Set portSettingObject = port.Associators_(“Msvm_ElementSettingData”, “Msvm_EthernetPortAllocationSettingData”).ItemIndex(0)
‘Port bandwidth setting
Set queryResult = portSettingObject.Associators_(“Msvm_EthernetPortSettingDataComponent”, “Msvm_EthernetSwitchPortBandwidthSettingData”)
If (queryResult.Count > 0) Then
Set portBandwidthData = queryResult.ItemIndex(0)
Call AddXmlNodeEntry(xmlDoc, “BurstLimit”, portBandwidthData.BurstLimit, objPortBandwidth, objPortBurstLimit)
Call AddXmlNodeEntry(xmlDoc, “BurstSize”, portBandwidthData.BurstSize, objPortBandwidth, objPortBurstSize)
Call AddXmlNodeEntry(xmlDoc, “Limit”, portBandwidthData.Limit, objPortBandwidth, objPortLimit)
Call AddXmlNodeEntry(xmlDoc, “Reservation”, portBandwidthData.Reservation, objPortBandwidth, objPortReservation)
Call AddXmlNodeEntry(xmlDoc, “Weight”, portBandwidthData.Weight, objPortBandwidth, objPortBurstWeight)
End if
‘ Port offload setting
Set queryResult = portSettingObject.Associators_(“Msvm_EthernetPortSettingDataComponent”, “Msvm_EthernetSwitchPortOffloadSettingData”)
If (queryResult.Count > 0) Then
Set portOffloadData = queryResult.ItemIndex(0)
if (portOffloadData.IOVInterruptModeration <= 2) Then
iovInterruptModeration = iovInterruptModerationArray(portOffloadData.IOVInterruptModeration)
Else
iovInterruptModeration = iovInterruptModerationArray(((portOffloadData.IOVInterruptModeration)/100)+2)
End if
Call AddXmlNodeEntry(xmlDoc, “IOVInterruptModeration”, iovInterruptModeration, objPortOffload, objPortIOVInterruptModeration)
Call AddXmlNodeEntry(xmlDoc, “IOVOffloadWeight”, portOffloadData.IOVOffloadWeight, objPortOffload, objPortIOVOffloadWeight)
Call AddXmlNodeEntry(xmlDoc, “IOVQueuePairsRequested”, portOffloadData.IOVQueuePairsRequested, objPortOffload, objPortIOVQueuePairsRequested)
Call AddXmlNodeEntry(xmlDoc, “IPSecOffloadLimit”, portOffloadData.IPSecOffloadLimit, objPortOffload, objPortIPSecOffloadLimit)
Call AddXmlNodeEntry(xmlDoc, “VMQOffloadWeight”, portOffloadData.VMQOffloadWeight, objPortOffload, objPortVMQOffloadWeight)
End If
‘ Port security setting
Set queryResult = portSettingObject.Associators_(“Msvm_EthernetPortSettingDataComponent”, “Msvm_EthernetSwitchPortSecuritySettingData”)
If (queryResult.Count > 0) Then
Set portSecurityData = queryResult.ItemIndex(0)
Call AddXmlNodeEntry(xmlDoc, “PortSecurity”, null, objPort, objPortSecurity)
Call AddXmlNodeEntry(xmlDoc, “AllowIeeePriorityTag”, onOffState(portSecurityData.AllowIeeePriorityTag+1), objPortSecurity, objPortAllowIeeePriorityTag)
Call AddXmlNodeEntry(xmlDoc, “AllowMacSpoofing”, onOffState(portSecurityData.AllowMacSpoofing+1), objPortSecurity, objPortAllowMacSpoofing)
Call AddXmlNodeEntry(xmlDoc, “AllowTeaming”, onOffState(portSecurityData.AllowTeaming+1), objPortSecurity, objPortAllowTeaming)
Call AddXmlNodeEntry(xmlDoc, “EnableDhcpGuard”, onOffState(portSecurityData.EnableDhcpGuard+1), objPortSecurity, objPortEnableDhcpGuard)
Call AddXmlNodeEntry(xmlDoc, “EnableRouterGuard”, onOffState(portSecurityData.EnableRouterGuard+1), objPortSecurity, objPortEnableRouterGuard)
Call AddXmlNodeEntry(xmlDoc, “MonitorMode”, monitorModeArray(portSecurityData.MonitorMode), objPortSecurity, objPortMonitorMode)
Call AddXmlNodeEntry(xmlDoc, “MonitorSession”, portSecurityData.MonitorSession, objPortSecurity, objPortMonitorSession)
Call AddXmlNodeEntry(xmlDoc, “TeamName”, portSecurityData.TeamName, objPortSecurity, objPortTeamName)
Call AddXmlNodeEntry(xmlDoc, “TeamNumber”, portSecurityData.TeamNumber, objPortSecurity, objPortTeamNumber)
Call AddXmlNodeEntry(xmlDoc, “VirtualSubnetId”, portSecurityData.VirtualSubnetId, objPortSecurity, objPortVirtualSubnetId)
Call AddXmlNodeEntry(xmlDoc, “StormLimit”, portSecurityData.StormLimit, objPortSecurity, objPortStormLimit)
Call AddXmlNodeEntry(xmlDoc, “DynamicIPAddressLimit”, portSecurityData.DynamicIPAddressLimit, objPortSecurity, objPortDynamicIPAddressLimit)
End If
‘ Port isolation setting
Set queryResult = portSettingObject.Associators_(“Msvm_EthernetPortSettingDataComponent”, “Msvm_EthernetSwitchPortIsolationSettingData”)
If (queryResult.Count > 0) Then
Set portIsolationData = queryResult.ItemIndex(0)
Call AddXmlNodeEntry(xmlDoc, “PortIsolation”, null, objPort, objPortIsolation)
Call AddXmlNodeEntry(xmlDoc, “IsolationMode”, isolationModeArray(portIsolationData.IsolationMode), objPortIsolation, objPortIsolationMode)
Call AddXmlNodeEntry(xmlDoc, “DefaultIsolationId”, portIsolationData.DefaultIsolationId, objPortIsolation, objPortDefaultIsolationId)
Call AddXmlNodeEntry(xmlDoc, “AllowUntaggedTraffic”, onOffState(portIsolationData.AllowUntaggedTraffic+1), objPortIsolation, objPortAllowUntaggedTraffic)
Call AddXmlNodeEntry(xmlDoc, “EnableMultiTenantStack”, onOffState(portIsolationData.EnableMultiTenantStack+1), objPortIsolation, objPortEnableMultiTenantStack)
End If
‘ Port routing domain setting
Set queryResult = portSettingObject.Associators_(“Msvm_EthernetPortSettingDataComponent”, “Msvm_EthernetSwitchPortRoutingDomainSettingData”)
If (queryResult.Count > 0) Then
Call AddXmlNodeEntry(xmlDoc, “PortRoutingDomainList”, null, objPort, objPortRoutingDomainList)
For each portRoutingDomainData in queryResult
Call AddXmlNodeEntry(xmlDoc, “PortRoutingDomainMapping”, null, objPortRoutingDomainList, objPortRoutingDomain)
Call AddXmlNodeEntry(xmlDoc, “RoutingDomainGuid”, portRoutingDomainData.RoutingDomainGuid, objPortRoutingDomain, objPortRoutingDomainGuid)
Call AddXmlNodeEntry(xmlDoc, “RoutingDomainName”, portRoutingDomainData.RoutingDomainName, objPortRoutingDomain, objPortRoutingDomainName)
isolationIdString = “”
for each isolationId In portRoutingDomainData.IsolationIdList
isolationIdString = isolationIdString & isolationId & ” ”
Next
Call AddXmlNodeEntry(xmlDoc, “IsolationIdList”, isolationIdString, objPortRoutingDomain, objPortIsolationIdList)
isolationIdNameString = “”
for each isolationIdName In portRoutingDomainData.IsolationIdNameList
isolationIdNameString = isolationIdNameString & isolationIdName & ” ”
Next
Call AddXmlNodeEntry(xmlDoc, “IsolationIdNameList”, isolationIdNameString, objPortRoutingDomain, objPortIsolationIdNameList)
Next
End If
‘Port VLAN setting
Set queryResult = portSettingObject.Associators_(“Msvm_EthernetPortSettingDataComponent”, “Msvm_EthernetSwitchPortVlanSettingData”)
If (queryResult.Count > 0) Then
Set portVlanData = queryResult.ItemIndex(0)
Call AddXmlNodeEntry(xmlDoc, “PortVlan”, null, objPort, objPortVlan)
Call AddXmlNodeEntry(xmlDoc, “VlanMode”, vlanModeArray(portVlanData.OperationMode), objPortVlan, objPortVlanMode)
if (portVlanData.OperationMode = 1) Then
Call AddXmlNodeEntry(xmlDoc, “AccessVlanId”, portVlanData.AccessVlanId, objPortVlan, objPortVlanAccess)
End If
if (portVlanData.OperationMode = 2) Then
Call AddXmlNodeEntry(xmlDoc, “NativeVlanId”, portVlanData.NativeVlanId, objPortVlan, objPortVlanNative)
trunkVlanString = “”
for each trunkVlanId In portVlanData.TrunkVlanIdArray
trunkVlanString = trunkVlanString & trunkVlanId & ” ”
Next
Call AddXmlNodeEntry(xmlDoc, “TrunkVlanArray”, trunkVlanString, objPortVlan, objPortVlanTrunk)
pruneVlanString = “”
for each prunevlanId In portVlanData.PruneVlanIdArray
tpruneVlanString = pruneVlanString & prunevlanId & ” ”
Next
Call AddXmlNodeEntry(xmlDoc, “PruneVlanArray”, trunkVlanString, objPortVlan, objPortVlanPrune)
End If
if (portVlanData.OperationMode = 3) Then
Call AddXmlNodeEntry(xmlDoc, “PvlanMode”, PvlanModeArray(portVlanData.PvlanMode), objPortVlan, objPortPVlanMode)
Call AddXmlNodeEntry(xmlDoc, “PrimaryVlanId”, portVlanData.PrimaryVlanId, objPortVlan, objPortPrimaryVlanId)
Call AddXmlNodeEntry(xmlDoc, “SecondaryVlanId”, portVlanData.SecondaryVlanId, objPortVlan, objPortSecondaryVlanId)
secondaryVlanString = “”
for each secondaryVlanId In portVlanData.SecondaryVlanIdArray
secondaryVlanString = secondaryVlanString & secondaryVlanId & ” ”
Next
Call AddXmlNodeEntry(xmlDoc, “SecondaryVlanArray”, secondaryVlanString, objPortVlan, objPortVlanSecondary)
End If
End If
‘Extended Port ACLs
Set queryResult = portSettingObject.Associators_(“Msvm_EthernetPortSettingDataComponent”, “Msvm_EthernetSwitchPortExtendedAclSettingData”)
If (queryResult.Count > 0) Then
Call AddXmlNodeEntry(xmlDoc, “PortExtendedAclList”, null, objPort, objPortEaclList)
for each extendedacl In queryResult
Call AddXmlNodeEntry(xmlDoc, “ExtendedAcl”, null, objPortEaclList, objPortEacl)
Call AddXmlNodeEntry(xmlDoc, “Action”, aclActionArray(extendedAcl.Action), objPortEacl, objPortEaclAction)
Call AddXmlNodeEntry(xmlDoc, “Direction”, aclDirectionArray(extendedAcl.Direction), objPortEacl, objPortEaclDirection)
Call AddXmlNodeEntry(xmlDoc, “Weight”, extendedAcl.Weight, objPortEacl, objPortEaclWeight)
Call AddXmlNodeEntry(xmlDoc, “Protocol”, extendedAcl.Protocol, objPortEacl, objPortEaclProtocol)
Call AddXmlNodeEntry(xmlDoc, “LocalIPAddress”, extendedAcl.LocalIPAddress, objPortEacl, objPortEaclLocalIP)
Call AddXmlNodeEntry(xmlDoc, “LocalPort”, extendedAcl.LocalPort, objPortEacl, objPortEaclLocalPort)
Call AddXmlNodeEntry(xmlDoc, “RemoteIPAddress”, extendedAcl.RemoteIPAddress, objPortEacl, objPortEaclRemoteIP)
Call AddXmlNodeEntry(xmlDoc, “RemotePort”, extendedAcl.RemotePort, objPortEacl, objPortEaclRemotePort)
Call AddXmlNodeEntry(xmlDoc, “Stateful”, onOffState(extendedAcl.Stateful+1), objPortEacl, objPortEaclStateful)
Call AddXmlNodeEntry(xmlDoc, “IsolationID”, extendedAcl.IsolationID, objPortEacl, objPortEaclIsolationId)
Next
End If
‘Port ACLs
Set queryResult = portSettingObject.Associators_(“Msvm_EthernetPortSettingDataComponent”, “Msvm_EthernetSwitchPortAclSettingData”)
If (queryResult.Count > 0) Then
Call AddXmlNodeEntry(xmlDoc, “PortAclList”, null, objPort, objPortAclList)
for each acl In queryResult
Call AddXmlNodeEntry(xmlDoc, “Acl”, null, objPortAclList, objPortAcl)
Call AddXmlNodeEntry(xmlDoc, “Action”, aclActionArray(acl.Action), objPortAcl, objPortAclAction)
Call AddXmlNodeEntry(xmlDoc, “AclType”, aclTypeArray(acl.AclType), objPortAcl, objPortAclType)
Call AddXmlNodeEntry(xmlDoc, “Applicability”, aclApplicabilityArray(acl.Applicability), objPortAcl, objPortAclApplicability)
Call AddXmlNodeEntry(xmlDoc, “Direction”, aclDirectionArray(acl.Direction), objPortAcl, objPortAclDirection)
Call AddXmlNodeEntry(xmlDoc, “LocalAddress”, acl.LocalAddress, objPortAcl, objPortAclLocalAddress)
Call AddXmlNodeEntry(xmlDoc, “LocalAddressPrefixLength”, acl.LocalAddressPrefixLength, objPortAcl, objPortAclLocalAddressPrefixLength)
Call AddXmlNodeEntry(xmlDoc, “RemoteAddress”, acl.RemoteAddress, objPortAcl, objPortAclRemoteAddress)
Call AddXmlNodeEntry(xmlDoc, “RemoteAddressPrefixLength”, acl.RemoteAddressPrefixLength, objPortAcl, objPortAclRemoteAddressPrefixLength)
Next
End If

‘Connected NIC
Set portLanEndPoint = port.Associators_(“Msvm_EthernetDeviceSAPImplementation”, “Msvm_LANEndpoint”).ItemIndex(0)
Set nicLanEndPoint = portLanEndPoint.Associators_(“Msvm_ActiveConnection”, “Msvm_LANEndpoint”).ItemIndex(0)
logNic = false

‘Synthetic NIC
Set queryResult = nicLanEndPoint.Associators_(“Msvm_DeviceSAPImplementation”, “Msvm_SyntheticEthernetPort”)
If (queryResult.Count > 0) Then
Set nic = queryResult.ItemIndex(0)
nicType = 0
logNic = True
End If

‘Emulated NIC
Set queryResult = nicLanEndPoint.Associators_(“Msvm_DeviceSAPImplementation”, “Msvm_EmulatedEthernetPort”)
If (queryResult.Count > 0) Then
Set nic = queryResult.ItemIndex(0)
nicType = 1
logNic = True
End If

‘Internal NIC
Set queryResult = nicLanEndPoint.Associators_(“Msvm_EthernetDeviceSAPImplementation”, “Msvm_InternalEthernetPort”)
If (queryResult.Count > 0) Then
Set nic = queryResult.ItemIndex(0)
nicType = 2
logNic = True
End If

‘External NIC
Set queryResult = nicLanEndPoint.Associators_(“Msvm_EthernetDeviceSAPImplementation”, “Msvm_ExternalEthernetPort”)
If (queryResult.Count > 0) Then
Set nic = queryResult.ItemIndex(0)
nicType = 3
logNic = True
End If

If (logNic = True) Then
Call AddXmlNodeEntry(xmlDoc, “Nic”, null, objPort, objNic)
Call AddXmlNodeEntry(xmlDoc, “DeviceId”, nic.DeviceId, objNic, objNicId)
Call AddXmlNodeEntry(xmlDoc, “NicType”, nicTypeArray(nicType), objNic, objNicId)
If (IsNull(nic.NetworkAddresses) = False) Then
For Each networkAddress In nic.NetworkAddresses
Call AddXmlNodeEntry(xmlDoc, “NetworkAddress”, networkAddress, objNic, objNicNetAddress)
Next
End If
Call AddXmlNodeEntry(xmlDoc, “PermanentAddress”, nic.PermanentAddress, objNic, objNicPermAddress)
Call AddXmlNodeEntry(xmlDoc, “ActiveMTU”, nic.ActiveMaximumTransmissionUnit, objNic, objNicActiveMTU)
If (nicType = 0 Or nicType = 1) Then
Call AddXmlNodeEntry(xmlDoc, “VMId”, nic.SystemName, objNic, objNicVmId)
strQuery = “Select * from MSVM_ComputerSystem WHERE Name='” + nic.SystemName + “‘”
Set queryResult = objVirtualizationService.ExecQuery(strQuery)
If (queryResult.Count > 0) Then
Set vm = queryResult.ItemIndex(0)
Call AddXmlNodeEntry(xmlDoc, “VMName”, vm.ElementName, objNic, objNicVmName)
End If
End If
End If
Next
Next

‘ Disconnected NIC info
strQueryArray = Array(“Select * from MSVM_SyntheticEthernetPort”, “Select * from MSVM_EmulatedEthernetPort”)
nicType = 0
Call AddXmlNodeEntry(xmlDoc, “DisconnectedNics”, null, objRoot, objDisconnectedNics)
For Each strQuery in strQueryArray
Set switchPort = objVirtualizationService.ExecQuery (strQuery)
For Each nic In switchPort
Set lanEndPoint = port.Associators_(“Msvm_DeviceSAPImplementation”, “Msvm_LANEndpoint”)
Set connectedlanEndPoint = lanEndPoint.Associators_(“Msvm_ActiveConnection”, “Msvm_LANEndpoint”)
if (connectedlanEndPoint.Count = 0) Then
Call AddXmlNodeEntry(xmlDoc, “Nic”, null, objDisconnectedNics, objNic)
Call AddXmlNodeEntry(xmlDoc, “DeviceId”, nic.DeviceId, objNic, objNicId)
Call AddXmlNodeEntry(xmlDoc, “NicType”, nicTypeArray(nicType), objNic, objNicId)
If (IsNull(nic.NetworkAddresses) = False) Then
For Each networkAddress In nic.NetworkAddresses
Call AddXmlNodeEntry(xmlDoc, “NetworkAddress”, networkAddress, objNic, objNicNetAddress)
Next
End If
Call AddXmlNodeEntry(xmlDoc, “PermanentAddress”, nic.PermanentAddress, objNic, objNicPermAddress)
Call AddXmlNodeEntry(xmlDoc, “ActiveMTU”, nic.ActiveMaximumTransmissionUnit, objNic, objNicActiveMTU)
If (nicType = 0 Or nicType = 1) Then
Call AddXmlNodeEntry(xmlDoc, “VMId”, nic.SystemName, objNic, objNicVmId)
strQuery = “Select * from MSVM_ComputerSystem WHERE Name='” + nic.SystemName + “‘”
Set queryResult = objVirtualizationService.ExecQuery(strQuery)
If (queryResult.Count > 0) Then
Set vm = queryResult.ItemIndex(0)
Call AddXmlNodeEntry(xmlDoc, “VMName”, vm.ElementName, objNic, objNicVmName)
End If
End If
End If
Next
nicType = nicType + 1
Next

Set objIntro = xmlDoc.CreateProcessingInstruction (“xml”, “version=’1.0′”)
xmlDoc.insertBefore objIntro, xmlDoc.childNodes(0)
xmlDoc.Save outputFileName

Else

End If

End Sub

Sub GetVmswitchLog(vmswitchlogFileName, vmmslogFileName)
On Error Resume Next

Set objShell = WScript.CreateObject( “WScript.Shell” )

‘Export the vmswitch events from system log
cmd = “cmd /c wevtutil epl System /q:””*[System[Provider[@Name=’Microsoft-Windows-Hyper-V-VmSwitch’]]]”” ” & vmswitchlogFileName
objShell.Run cmd, 0, True

‘Archive the log so that it can be read on different machines
cmd = “cmd /c wevtutil al ” & vmswitchlogFileName
objShell.Run cmd, 0, True

‘Export the VMMS networking log
cmd = “cmd /c wevtutil epl “”Microsoft-Windows-Hyper-V-VMMS-Networking”” ” & vmmslogFileName
objShell.Run cmd, 0, True

‘Archive the log so that it can be read on different machines
cmd = “cmd /c wevtutil al ” & vmmslogFileName
objShell.Run cmd, 0, True
End Sub

Sub GetApplicationExportLog(logFileName)
On Error Resume Next

Set objShell = WScript.CreateObject( “WScript.Shell” )

‘Export the ApplicationExport log
cmd = “cmd /c wevtutil epl Application ” & logFileName
objShell.Run cmd, 0, True

‘Archive the log so that it can be read on different machines
cmd = “cmd /c wevtutil al ” & logFileName
objShell.Run cmd, 0, True
End Sub

Sub GetSystemExportLog(logFileName)
On Error Resume Next

Set objShell = WScript.CreateObject( “WScript.Shell” )

‘Export the ApplicationExport log
cmd = “cmd /c wevtutil epl System ” & logFileName
objShell.Run cmd, 0, True

‘Archive the log so that it can be read on different machines
cmd = “cmd /c wevtutil al ” & logFileName
objShell.Run cmd, 0, True
End Sub

Sub GetHotFixInfo(outputFileName)
On Error Resume Next

Set objShell = WScript.CreateObject( “WScript.Shell” )

cmd = “cmd /c wmic qfe >> ” & outputFileName
objShell.Run cmd, 0, True
End Sub

Sub GetCreateBindingMap(outputFileName)
On Error Resume Next

Set objShell = WScript.CreateObject( “WScript.Shell” )

cmd = “cmd /c netcfg -m >> ” & outputFileName
objShell.Run cmd, 0, True
End Sub

Sub GetWinsockLog(outputFileName)
On Error Resume Next

Set objShell = WScript.CreateObject( “WScript.Shell” )

cmd = “cmd /c reg.exe query hklm\system\CurrentControlSet\Services\Winsock\Parameters /v Transports >> ” & outputFileName
objShell.Run cmd, 0, True

cmd = “cmd /c reg.exe query “”hklm\system\CurrentControlSet\Services\Winsock\Setup Migration”” /v “”Provider List”” >> ” & outputFileName
objShell.Run cmd, 0, True

cmd = “cmd /c netsh.exe winsock show catalog >> ” & outputFileName
objShell.Run cmd, 0, True
End Sub

Sub GetEpdPolicies(outputFileName)
On Error Resume Next

Set objShell = WScript.CreateObject( “WScript.Shell” )

cmd = “cmd /c Reg.exe Export HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\EnterpriseDataProtection\Policies ” & outputFileName & ” /y /Reg:64″
objShell.Run cmd, 0, True
End Sub

Sub GetPolicyManager(outputFileName)
On Error Resume Next

Set objShell = WScript.CreateObject( “WScript.Shell” )

cmd = “cmd /c Reg.exe Export HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\PolicyManager\Providers ” & outputFileName & ” /y /Reg:64″
objShell.Run cmd, 0, True
End Sub

Sub GetHomeGroupListener(outputFileName)
On Error Resume Next

Set objShell = WScript.CreateObject( “WScript.Shell” )

cmd = “cmd /c Reg.exe Export HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\HomeGroupListener ” & outputFileName & ” /y /Reg:64″
objShell.Run cmd, 0, True
End Sub

Sub GetHomeGroupProvider(outputFileName)
On Error Resume Next

Set objShell = WScript.CreateObject( “WScript.Shell” )

cmd = “cmd /c Reg.exe Export HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\HomeGroupProvider ” & outputFileName & ” /y /Reg:64″
objShell.Run cmd, 0, True
End Sub

Sub GetServiceLogInfo(outputFileName)
On Error Resume Next

Set objShell = WScript.CreateObject( “WScript.Shell” )

cmd = “cmd /c sc.exe queryex nativewifip >> ” & outputFileName
objShell.Run cmd, 0, True

cmd = “cmd /c sc.exe qc nativewifip >> ” & outputFileName
objShell.Run cmd, 0, True

cmd = “cmd /c sc.exe queryex wlansvc >> ” & outputFileName
objShell.Run cmd, 0, True

cmd = “cmd /c sc.exe qc wlansvc >> ” & outputFileName
objShell.Run cmd, 0, True

cmd = “cmd /c sc.exe queryex dhcp >> ” & outputFileName
objShell.Run cmd, 0, True

cmd = “cmd /c sc.exe qc dhcp >> ” & outputFileName
objShell.Run cmd, 0, True
End Sub

Sub GetPowershellInfo(outputFileName)
On Error Resume Next

Set objShell = WScript.CreateObject( “WScript.Shell” )

cmd = “powershell -command ” & _
“$net_adapter=(Get-NetAdapter -IncludeHidden); ” & _
“$output= ($net_adapter); ” & _
“$output += ($net_adapter | fl *); ” & _
“$output += (Get-NetAdapterAdvancedProperty | fl); ” & _
“$net_adapter_bindings=(Get-NetAdapterBinding -IncludeHidden); ” & _
“$output += ($net_adapter_bindings); ” & _
“$output += ($net_adapter_bindings | fl); ” & _
“$output += (Get-NetIpConfiguration -Detailed); ” & _
“$output += (Get-DnsClientNrptPolicy); ” & _
“$output += (Resolve-DnsName bing.com); ” & _
“$output += (ping bing.com -4); ” & _
“$output += (ping bing.com -6); ” & _
“$output += (Test-NetConnection bing.com -InformationLevel Detailed); ” & _
“$output += (Test-NetConnection bing.com -InformationLevel Detailed -CommonTCPPort HTTP); ” & _
“$output += (Get-NetRoute); ” & _
“$output += (Get-NetIPaddress); ” & _
“$output += (Get-NetLbfoTeam); ” & _
“$output += (Get-Service -Name:VMMS); ” & _
“$output += (Get-VMSwitch); ” & _
“$output += “”(Get-VMNetworkAdapter -all)””; ” & _
“$output += (Get-DnsClientNrptPolicy); ” & _
“$output += (Get-WindowsOptionalFeature -Online); ” & _
“$output += (Get-Service | fl); ” & _
“$pnp_devices = (Get-PnpDevice); ” & _
“$output += ($pnp_devices); ” & _
“$output += ($pnp_devices | Get-PnpDeviceProperty -KeyName DEVPKEY_Device_InstanceId,DEVPKEY_Device_DevNodeStatus,DEVPKEY_Device_ProblemCode); ” & _
“$output | Out-File ” & outputFileName

objShell.Run cmd, 0, True
End Sub

Sub GetExistingFile(inputFileName, outputDirectory)
On Error Resume Next

dim outputPath

outputPath = outputDirectory & “\”
outputPath = Replace(outputPath, “\”, “\”)

If fso.FileExists(inputFileName) Then
fso.CopyFile inputFileName, outputPath
End If
End Sub

Sub GetExistingFiles(inputPath, outputPath, filePrefix, fileSuffix)
On Error Resume Next

exists = fso.FolderExists(inputpath)
if (exists) then
Set objFolder = fso.GetFolder(inputpath)
Set colFiles = objFolder.Files
Set fileNameForCab = “”
For Each objFile in colFiles
if Left(objFile.Name, Len(filePrefix)) = filePrefix THEN
if Right(objFile.Name, Len(fileSuffix)) = fileSuffix THEN
Call GetExistingFile(inputPath & objFile.Name, outputPath)
fileNameForCab = Replace(objFile.Name, “%”, “-“)
fso.MoveFile outputPath & “\” & objFile.Name, outputPath & “\” & fileNameForCab
end if
end if
Next
end if
End Sub

Sub GetExistingFiles(inputPath, outputPath, filePrefix)
On Error Resume Next

exists = fso.FolderExists(inputpath)
if (exists) then
Set objFolder = fso.GetFolder(inputpath)
Set colFiles = objFolder.Files
Set fileNameForCab = “”
For Each objFile in colFiles
if Left(objFile.Name, Len(filePrefix)) = filePrefix THEN
Call GetExistingFile(inputPath & objFile.Name, outputPath)
fileNameForCab = Replace(objFile.Name, “%”, “-“)
fso.MoveFile outputPath & “\” & objFile.Name, outputPath & “\” & fileNameForCab
end if
Next
end if
End Sub

Sub GetPantherFiles(inputPath, outputPath, outputFilePrefix, filePrefix, fileSuffix)
On Error Resume Next

exists = fso.FolderExists(inputpath)
if (exists) then
Set objFolder = fso.GetFolder(inputpath)
Set colFiles = objFolder.Files

For Each objFile in colFiles
if Left(objFile.Name, Len(filePrefix)) = filePrefix THEN
if Right(objFile.Name, Len(fileSuffix)) = fileSuffix THEN
Call GetExistingFile(inputPath & objFile.Name, outputPath)
‘add prefix to output file to avoid copying over files with identical names
fso.MoveFile outputPath & “\” & objFile.Name, outputPath & “\” & outputFilePrefix & objFile.Name
end if
end if
Next
end if
End Sub

Sub GetWlanReport(outputPath)
On Error Resume Next

dim wlanOutputPath
wlanOutputPath = shell.ExpandEnvironmentStrings(“%programdata%\”) & “Microsoft\Windows\WlanReport\”
exists = fso.FolderExists(wlanOutputPath)
if (exists) then
Set objFolder = fso.GetFolder(wlanOutputPath)
objFolder.Delete True
end if

Set objShell = WScript.CreateObject( “WScript.Shell” )
cmd = “cmd /c netsh wlan show wlanreport”
objShell.Run cmd, 0, True

Set colFiles = objFolder.Files
For Each objFile in colFiles
Call GetExistingFile(wlanOutputPath & objFile.Name, outputPath)
Next
End Sub

Sub GetBatteryReport(batteryReportFilename)
On Error Resume Next

Set objShell = WScript.CreateObject( “WScript.Shell” )
cmd = “cmd /c powercfg.exe /batteryreport /output ” & batteryReportFilename
objShell.Run cmd, 0, True

End Sub

Sub GetLatestNdfSessionEtlFile(inputPath, outputPath, filePrefix, fileSuffix)

currentDirectory = fso.GetAbsolutePathName(“.”)
dirParts = Split(currentDirectory, “\”)
drive = dirParts(0)
usersFolder = dirParts(1)
username = dirParts(2)
fullInputPath = drive + “\” + usersFolder + “\” + username + “\” + inputPath

exists = fso.FolderExists(fullInputPath)
if (exists) then
Set objFolder = fso.GetFolder(fullInputPath)
Set colFiles = objFolder.Files
Set mostRecent = Nothing
For Each objFile in colFiles
if Left(objFile.Name, Len(filePrefix)) = filePrefix THEN
if Right(objFile.Name, Len(fileSuffix)) = fileSuffix THEN
if (mostRecent is Nothing) THEN
Set mostRecent = objFile
elseif (objFile.DateLastModified > mostRecent.DateLastModified) THEN
Set mostRecent = objFile
end if
end if
end if
Next
if NOT (mostRecent is Nothing) THEN
Call GetExistingFile(fullInputPath & mostRecent.Name, outputPath)
end if
end if
End Sub

On Error Resume Next

Dim adapterInfoFile, netInfoFile, WcnInfoFile

Set FSO = CreateObject(“Scripting.FileSystemObject”)
Set shell = WScript.CreateObject( “WScript.Shell” )
sysdrive = shell.ExpandEnvironmentStrings(“%SystemDrive%\”)
systemRoot = shell.ExpandEnvironmentStrings(“%SystemRoot%\”)

configFolder = “config”
osinfoFileName = configFolder + “\osinfo.txt”
adapterinfoFileName = configFolder + “\adapterinfo.txt”
envinfoFileName = configFolder + “\envinfo.txt”
wirelessAutoconfigLogFileName = configFolder + “\WLANAutoConfigLog.evtx”
wcmLogFileName = configFolder + “\WCMLog.evtx”
wwanLogFileName = configFolder + “\WWANLog.evtx”
wscatFileName = configFolder + “\WinsockCatalog.txt”
miracastFileName = configFolder + “\wlaninfo.txt”
wcnFileName = configFolder + “\WcnInfo.txt”
wcncachedumpFile= sysdrive + “\wcncachedump.txt”
windowsFirewallConfigFileName = configFolder + “\WindowsFirewallConfig.txt”
windowsFirewallEffectiveRulesFileName = configFolder + “\WindowsFirewallEffectiveRules.txt”
windowsFirewallLogFileName = configFolder + “\WindowsFirewallLog.evtx”
windowsFirewallConsecLogFileName = configFolder + “\WindowsFirewallConsecLog.evtx”
windowsFirewallVerboseLogFileName = configFolder + “\WindowsFirewallLogVerbose.evtx”
windowsFirewallConsecVerboseLogFileName = configFolder + “\WindowsFirewallConsecLogVerbose.evtx”
wfpfiltersfilename=configFolder + “\wfpfilters.xml”
wfplogfilename=configFolder + “\wfplog.log”
netioStateFilename=configFolder + “\netiostate.txt”
dnsInfoFileName = configFolder + “\Dns.txt”
neighborsFileName = configFolder + “\Neighbors.txt”
filesharingFileName = configFolder + “\FileSharing.txt”
gpresultFileName = configFolder + “\gpresult.txt”
neteventsFileName = configFolder + “\netevents.xml”
neteventsFileLog = configFolder + “\neteventslog.txt”
showstateFileName = configFolder + “\wfpstate.xml”
showstateFileLog = configFolder + “\wfpstatelog.txt”
sysportsFileName = configFolder + “\sysports.xml”
sysportsFileLog = configFolder + “\sysportslog.txt”
vmswitchFileName = configFolder + “\vmswitchInfo.xml”
vmswitchLogFileName = configFolder + “\VmSwitchLog.evtx”
vmmsLogFileName = configFolder + “\VmmsNetworkingLog.evtx”
applicationExportFileName = configFolder + “\Application_Export.evtx”
systemExportFileName = configFolder + “\System_Export.evtx”
hotFixInfoFileName = configFolder + “\Hotfixinfo.log”
createBindingMapFileName = configFolder + “\CreateBindingMap.log”
serviceInfoFileName = configFolder + “\serviceinfo.log”
powershellInfoFileName = configFolder + “\PowershellInfo.log”
evtxInputFilePath = systemRoot + “System32\Winevt\Logs\”
dhcpEvtxInputFilePrefix = “Microsoft-Windows-Dhcp”
dhcpEvtxInputFileSuffix = “.evtx”
ncsiEvtxInputFilePrefix = “Microsoft-Windows-NCSI”
ncsiEvtxInputFileSuffix = “Operational.evtx”
wcmsvcEvtxInputFilePrefix = “Microsoft-Windows-Wcmsvc”
wcmsvcEvtxInputFileSuffix = “Operational.evtx”
wlanAutoConfigEvtxInputFilePrefix = “Microsoft-Windows-WLAN-AutoConfig”
wlanAutoConfigEvtxInputFileSuffix = “.evtx”
serviceEtlFilePrefix = “service.”
scmEvmFilePrefix = “SCM.”
etlFileSuffix = “.etl”
serviceEtlFilePath = systemRoot + “\Logs\NetSetup\”
scmEvmfilePath = systemRoot + “\System32\LogFiles\SCM\”
winsockLogFileName = configFolder + “\winsock.log”
netsetupigFileName = systemRoot + “\System32\netsetupmig.log”
pantherSetupFilePrefix = “setup”
pantherSetupFileSuffix = “.log”
windowsPantherInputPath = systemRoot + “panther\”
windowsPantherOutputFilePrefix = “windows_panther_”
sourcesPantherInputPath = sysdrive + “$Windows.~BT\Sources\Panther\”
sourcesPantherOutputFilePrefix = “sources_panther_”
edpPoliciesFileName = configFolder + “\EDPPolicies.reg”
policyManagerFileName = configFolder + “\PolicyManager.reg”
homeGroupListenerFileName = configFolder + “\HomeGroupListener.reg”
homeGroupProviderFileName = configFolder + “\HomeGroupProvider.reg”
netTraceInputPath = “AppData\Local\Microsoft\NetTraces\”
netTraceEtlFilePrefix = “NdfSession”
batteryReportFilename = configFolder + “\battery-report.html”

if Not FSO.FolderExists(configFolder) Then
FSO.CreateFolder configFolder
End If

call GetGPResultInfo(gpresultFileName)

call DumpAllKeys

call GetOSInfo(osinfoFileName)

call GetBatteryReport(batteryReportFilename)

Set adapterInfoFile = FSO.OpenTextFile(adapterInfoFileName, 2, True)

call GetWirelessAdapterInfo(adapterInfoFile)

call GetWiredAdapterInfo(adapterInfoFile)

adapterInfoFile.Close

call GetWirelessAutoconfigLog(wirelessAutoConfigLogFileName)

call GetWcmLog(wcmLogFileName)

call GetWwanLog(wwanLogFileName)

call GetEnvironmentInfo(envinfoFileName)

call DumpWinsockCatalog(wscatFileName)

call GetWindowsFirewallInfo(windowsFirewallConfigFileName, windowsFirewallLogFileName, windowsFirewallEffectiveRulesFileName,windowsFirewallConsecLogFileName, windowsFirewallVerboseLogFileName, windowsFirewallConsecVerboseLogFileName)

call GetMiracastInfo(miracastFileName)

call GetWcnInfo(wcnFileName)

call GetNetioInfo(netioStateFilename)

call GetDnsInfo(dnsInfoFileName)

call GetNeighborInfo(neighborsFileName)

call GetFileSharingInfo(filesharingFileName)

call GetNetEventsInfo(neteventsFileName, neteventsFileLog)

call GetShowStateInfo(showstateFileName, showstateFileLog)

call GetSysPortsInfo(sysportsFileName, sysportsFileLog)

call GetVmswitchInfo(vmswitchFileName)

Call GetVmswitchLog(vmswitchLogFileName, vmmsLogFileName)

Call GetHotFixInfo(hotFixInfoFileName)

Call GetServiceLogInfo(serviceInfoFileName)

Call GetExistingFiles(scmEvmfilePath, configFolder, scmEvmFilePrefix)

Call GetPantherFiles(sourcesPantherInputPath, configFolder, sourcesPantherOutputFilePrefix, pantherSetupFilePrefix, pantherSetupFileSuffix)

Call GetWinsockLog(winsockLogFileName)

Call GetExistingFile(netsetupigFileName, configFolder)

Call GetEpdPolicies(edpPoliciesFileName)

Call GetPolicyManager(policyManagerFileName)

Call GetHomeGroupListener(homeGroupListenerFileName)

Call GetHomeGroupProvider(homeGroupProviderFileName)

Call GetLatestNdfSessionEtlFile(netTraceInputPath, configFolder, netTraceEtlFilePrefix, etlFileSuffix)

Call GetPowershellInfo(powershellInfoFileName)

Three Thousand.js

/* ***** BEGIN LICENSE BLOCK *****
* Distributed under the BSD license:
*
* Copyright (c) 2010, Ajax.org B.V.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
* * Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* * Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
* * Neither the name of Ajax.org B.V. nor the
* names of its contributors may be used to endorse or promote products
* derived from this software without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS “AS IS” AND
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
* DISCLAIMED. IN NO EVENT SHALL AJAX.ORG B.V. BE LIABLE FOR ANY
* DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
* ***** END LICENSE BLOCK ***** */

ace.define(‘ace/mode/html’, [‘require’, ‘exports’, ‘module’ , ‘ace/lib/oop’, ‘ace/mode/text’, ‘ace/mode/javascript’, ‘ace/mode/css’, ‘ace/tokenizer’, ‘ace/mode/html_highlight_rules’, ‘ace/mode/behaviour/html’, ‘ace/mode/folding/html’], function(require, exports, module) {

var oop = require(“../lib/oop”);
var TextMode = require(“./text”).Mode;
var JavaScriptMode = require(“./javascript”).Mode;
var CssMode = require(“./css”).Mode;
var Tokenizer = require(“../tokenizer”).Tokenizer;
var HtmlHighlightRules = require(“./html_highlight_rules”).HtmlHighlightRules;
var HtmlBehaviour = require(“./behaviour/html”).HtmlBehaviour;
var HtmlFoldMode = require(“./folding/html”).FoldMode;

var Mode = function() {
var highlighter = new HtmlHighlightRules();
this.$tokenizer = new Tokenizer(highlighter.getRules());
this.$behaviour = new HtmlBehaviour();

this.$embeds = highlighter.getEmbeds();
this.createModeDelegates({
“js-“: JavaScriptMode,
“css-“: CssMode
});

this.foldingRules = new HtmlFoldMode();
};
oop.inherits(Mode, TextMode);

(function() {

this.toggleCommentLines = function(state, doc, startRow, endRow) {
return 0;
};

this.getNextLineIndent = function(state, line, tab) {
return this.$getIndent(line);
};

this.checkOutdent = function(state, line, input) {
return false;
};

}).call(Mode.prototype);

exports.Mode = Mode;
});

ace.define(‘ace/mode/javascript’, [‘require’, ‘exports’, ‘module’ , ‘ace/lib/oop’, ‘ace/mode/text’, ‘ace/tokenizer’, ‘ace/mode/javascript_highlight_rules’, ‘ace/mode/matching_brace_outdent’, ‘ace/range’, ‘ace/worker/worker_client’, ‘ace/mode/behaviour/cstyle’, ‘ace/mode/folding/cstyle’], function(require, exports, module) {

var oop = require(“../lib/oop”);
var TextMode = require(“./text”).Mode;
var Tokenizer = require(“../tokenizer”).Tokenizer;
var JavaScriptHighlightRules = require(“./javascript_highlight_rules”).JavaScriptHighlightRules;
var MatchingBraceOutdent = require(“./matching_brace_outdent”).MatchingBraceOutdent;
var Range = require(“../range”).Range;
var WorkerClient = require(“../worker/worker_client”).WorkerClient;
var CstyleBehaviour = require(“./behaviour/cstyle”).CstyleBehaviour;
var CStyleFoldMode = require(“./folding/cstyle”).FoldMode;

var Mode = function() {
this.$tokenizer = new Tokenizer(new JavaScriptHighlightRules().getRules());
this.$outdent = new MatchingBraceOutdent();
this.$behaviour = new CstyleBehaviour();
this.foldingRules = new CStyleFoldMode();
};
oop.inherits(Mode, TextMode);

(function() {

this.toggleCommentLines = function(state, doc, startRow, endRow) {
var outdent = true;
var re = /^(\s*)\/\//;

for (var i=startRow; i<= endRow; i++) {
if (!re.test(doc.getLine(i))) {
outdent = false;
break;
}
}

    if (outdent) {
        var deleteRange = new Range(0, 0, 0, 0);
        for (var i=startRow; i&lt;= endRow; i++)
        {
            var line = doc.getLine(i);
            var m = line.match(re);
            deleteRange.start.row = i;
            deleteRange.end.row = i;
            deleteRange.end.column = m[0].length;
            doc.replace(deleteRange, m[1]);
        }
    }
    else {
        doc.indentRows(startRow, endRow, "//");
    }
};

this.getNextLineIndent = function(state, line, tab) {
    var indent = this.$getIndent(line);

    var tokenizedLine = this.$tokenizer.getLineTokens(line, state);
    var tokens = tokenizedLine.tokens;
    var endState = tokenizedLine.state;

    if (tokens.length &amp;&amp; tokens[tokens.length-1].type == "comment") {
        return indent;
    }

    if (state == "start" || state == "regex_allowed") {
        var match = line.match(/^.*(?:\bcase\b.*\:|[\{\(\[])\s*$/);
        if (match) {
            indent += tab;
        }
    } else if (state == "doc-start") {
        if (endState == "start" || state == "regex_allowed") {
            return "";
        }
        var match = line.match(/^\s*(\/?)\*/);
        if (match) {
            if (match[1]) {
                indent += " ";
            }
            indent += "* ";
        }
    }

    return indent;
};

this.checkOutdent = function(state, line, input) {
    return this.$outdent.checkOutdent(line, input);
};

this.autoOutdent = function(state, doc, row) {
    this.$outdent.autoOutdent(doc, row);
};

this.createWorker = function(session) {
    var worker = new WorkerClient(["ace"], "ace/mode/javascript_worker", "JavaScriptWorker");
    worker.attachToDocument(session.getDocument());

    worker.on("jslint", function(results) {
        session.setAnnotations(results.data);
    });

    worker.on("terminate", function() {
        session.clearAnnotations();
    });

    return worker;
};

}).call(Mode.prototype);

exports.Mode = Mode;
});

ace.define(‘ace/mode/javascript_highlight_rules’, [‘require’, ‘exports’, ‘module’ , ‘ace/lib/oop’, ‘ace/mode/doc_comment_highlight_rules’, ‘ace/mode/text_highlight_rules’], function(require, exports, module) {

var oop = require(“../lib/oop”);
var DocCommentHighlightRules = require(“./doc_comment_highlight_rules”).DocCommentHighlightRules;
var TextHighlightRules = require(“./text_highlight_rules”).TextHighlightRules;

var JavaScriptHighlightRules = function() {
var keywordMapper = this.createKeywordMapper({
“variable.language”:
“Array|Boolean|Date|Function|Iterator|Number|Object|RegExp|String|Proxy|” + // Constructors
“Namespace|QName|XML|XMLList|” + // E4X
“ArrayBuffer|Float32Array|Float64Array|Int16Array|Int32Array|Int8Array|” +
“Uint16Array|Uint32Array|Uint8Array|Uint8ClampedArray|” +
“Error|EvalError|InternalError|RangeError|ReferenceError|StopIteration|” + // Errors
“SyntaxError|TypeError|URIError|” +
“decodeURI|decodeURIComponent|encodeURI|encodeURIComponent|eval|isFinite|” + // Non-constructor functions
“isNaN|parseFloat|parseInt|” +
“JSON|Math|” + // Other
“this|arguments|prototype|window|document” , // Pseudo
“keyword”:
“const|yield|import|get|set|” +
“break|case|catch|continue|default|delete|do|else|finally|for|function|” +
“if|in|instanceof|new|return|switch|throw|try|typeof|let|var|while|with|debugger|” +
parent|count|escape|unescape|with|proto|” +
“class|enum|extends|super|export|implements|private|public|interface|package|protected|static”,
“storage.type”:
“const|let|var|function”,
“constant.language”:
“null|Infinity|NaN|undefined”,
“support.function”:
“alert”,
“constant.language.boolean”: “true|false”
}, “identifier”);
var kwBeforeRe = “case|do|else|finally|in|instanceof|return|throw|try|typeof|yield|void”;
var identifierRe = “[a-zA-Z\$\u00a1-\uffff][a-zA-Z\d\$\u00a1-\uffff]*\b”;

var escapedRe = "\\\\(?:x[0-9a-fA-F]{2}|" + // hex
    "u[0-9a-fA-F]{4}|" + // unicode
    "[0-2][0-7]{0,2}|" + // oct
    "3[0-6][0-7]?|" + // oct
    "37[0-7]?|" + // oct
    "[4-7][0-7]?|" + //oct
    ".)";

this.$rules = {
    "start" : [
        {
            token : "comment",
            regex : /\/\/.*$/
        },
        DocCommentHighlightRules.getStartRule("doc-start"),
        {
            token : "comment", // multi line comment
            regex : /\/\*/,
            next : "comment"
        }, {
            token : "string",
            regex : "'(?=.)",
            next  : "qstring"
        }, {
            token : "string",
            regex : '"(?=.)',
            next  : "qqstring"
        }, {
            token : "constant.numeric", // hex
            regex : /0[xX][0-9a-fA-F]+\b/
        }, {
            token : "constant.numeric", // float
            regex : /[+-]?\d+(?:(?:\.\d*)?(?:[eE][+-]?\d+)?)?\b/
        }, {
            token : [
                "storage.type", "punctuation.operator", "support.function",
                "punctuation.operator", "entity.name.function", "text","keyword.operator"
            ],
            regex : "(" + identifierRe + ")(\\.)(prototype)(\\.)(" + identifierRe +")(\\s*)(=)",
            next: "function_arguments"
        }, {
            token : [
                "storage.type", "punctuation.operator", "entity.name.function", "text",
                "keyword.operator", "text", "storage.type", "text", "paren.lparen"
            ],
            regex : "(" + identifierRe + ")(\\.)(" + identifierRe +")(\\s*)(=)(\\s*)(function)(\\s*)(\\()",
            next: "function_arguments"
        }, {
            token : [
                "entity.name.function", "text", "keyword.operator", "text", "storage.type",
                "text", "paren.lparen"
            ],
            regex : "(" + identifierRe +")(\\s*)(=)(\\s*)(function)(\\s*)(\\()",
            next: "function_arguments"
        }, {
            token : [
                "storage.type", "punctuation.operator", "entity.name.function", "text",
                "keyword.operator", "text",
                "storage.type", "text", "entity.name.function", "text", "paren.lparen"
            ],
            regex : "(" + identifierRe + ")(\\.)(" + identifierRe +")(\\s*)(=)(\\s*)(function)(\\s+)(\\w+)(\\s*)(\\()",
            next: "function_arguments"
        }, {
            token : [
                "storage.type", "text", "entity.name.function", "text", "paren.lparen"
            ],
            regex : "(function)(\\s+)(" + identifierRe + ")(\\s*)(\\()",
            next: "function_arguments"
        }, {
            token : [
                "entity.name.function", "text", "punctuation.operator",
                "text", "storage.type", "text", "paren.lparen"
            ],
            regex : "(" + identifierRe + ")(\\s*)(:)(\\s*)(function)(\\s*)(\\()",
            next: "function_arguments"
        }, {
            token : [
                "text", "text", "storage.type", "text", "paren.lparen"
            ],
            regex : "(:)(\\s*)(function)(\\s*)(\\()",
            next: "function_arguments"
        }, {
            token : "keyword",
            regex : "(?:" + kwBeforeRe + ")\\b",
            next : "regex_allowed"
        }, {
            token : ["punctuation.operator", "support.function"],
            regex : /(\.)(s(?:h(?:ift|ow(?:Mod(?:elessDialog|alDialog)|Help))|croll(?:X|By(?:Pages|Lines)?|Y|To)?|t(?:opzzzz|rike)|i(?:n|zeToContent|debar|gnText)|ort|u(?:p|b(?:str(?:ing)?)?)|pli(?:ce|t)|e(?:nd|t(?:Re(?:sizable|questHeader)|M(?:i(?:nutes|lliseconds)|onth)|Seconds|Ho(?:tKeys|urs)|Year|Cursor|Time(?:out)?|Interval|ZOptions|Date|UTC(?:M(?:i(?:nutes|lliseconds)|onth)|Seconds|Hours|Date|FullYear)|FullYear|Active)|arch)|qrt|lice|avePreferences|mall)|h(?:ome|andleEvent)|navigate|c(?:har(?:CodeAt|At)|o(?:s|n(?:cat|textual|firm)|mpile)|eil|lear(?:Timeout|Interval)?|a(?:ptureEvents|ll)|reate(?:StyleSheet|Popup|EventObject))|t(?:o(?:GMTString|S(?:tring|ource)|U(?:TCString|pperCase)|Lo(?:caleString|werCase))|est|a(?:n|int(?:Enabled)?))|i(?:s(?:NaN|Finite)|ndexOf|talics)|d(?:isableExternalCapture|ump|etachEvent)|u(?:n(?:shift|taint|escape|watch)|pdateCommands)|j(?:oin|avaEnabled)|p(?:o(?:p|w)|ush|lugins.refresh|a(?:ddings|rse(?:Int|Float)?)|r(?:int|ompt|eference))|e(?:scape|nableExternalCapture|val|lementFromPoint|x(?:p|ec(?:Script|Command)?))|valueOf|UTC|queryCommand(?:State|Indeterm|Enabled|Value)|f(?:i(?:nd|le(?:ModifiedDate|Size|CreatedDate|UpdatedDate)|xed)|o(?:nt(?:size|color)|rward)|loor|romCharCode)|watch|l(?:ink|o(?:ad|g)|astIndexOf)|a(?:sin|nchor|cos|t(?:tachEvent|ob|an(?:2)?)|pply|lert|b(?:s|ort))|r(?:ou(?:nd|teEvents)|e(?:size(?:By|To)|calc|turnValue|place|verse|l(?:oad|ease(?:Capture|Events)))|andom)|g(?:o|et(?:ResponseHeader|M(?:i(?:nutes|lliseconds)|onth)|Se(?:conds|lection)|Hours|Year|Time(?:zoneOffset)?|Da(?:y|te)|UTC(?:M(?:i(?:nutes|lliseconds)|onth)|Seconds|Hours|Da(?:y|te)|FullYear)|FullYear|A(?:ttention|llResponseHeaders)))|m(?:in|ove(?:B(?:y|elow)|To(?:Absolute)?|Above)|ergeAttributes|a(?:tch|rgins|x))|b(?:toa|ig|o(?:ld|rderWidths)|link|ack))\b(?=\()/
        }, {
            token : ["punctuation.operator", "support.function.dom"],
            regex : /(\.)(s(?:ub(?:stringData|mit)|plitText|e(?:t(?:NamedItem|Attribute(?:Node)?)|lect))|has(?:ChildNodes|Feature)|namedItem|c(?:l(?:ick|o(?:se|neNode))|reate(?:C(?:omment|DATASection|aption)|T(?:Head|extNode|Foot)|DocumentFragment|ProcessingInstruction|E(?:ntityReference|lement)|Attribute))|tabIndex|i(?:nsert(?:Row|Before|Cell|Data)|tem)|open|delete(?:Row|C(?:ell|aption)|T(?:Head|Foot)|Data)|focus|write(?:ln)?|a(?:dd|ppend(?:Child|Data))|re(?:set|place(?:Child|Data)|move(?:NamedItem|Child|Attribute(?:Node)?)?)|get(?:NamedItem|Element(?:sBy(?:Name|TagName)|ById)|Attribute(?:Node)?)|blur)\b(?=\()/
        }, {
            token : ["punctuation.operator", "support.constant"],
            regex : /(\.)(s(?:ystemLanguage|cr(?:ipts|ollbars|een(?:X|Y|Top|Left))|t(?:yle(?:Sheets)?|atus(?:Text|bar)?)|ibling(?:Below|Above)|ource|uffixes|e(?:curity(?:Policy)?|l(?:ection|f)))|h(?:istory|ost(?:name)?|as(?:h|Focus))|y|X(?:MLDocument|SLDocument)|n(?:ext|ame(?:space(?:s|URI)|Prop))|M(?:IN_VALUE|AX_VALUE)|c(?:haracterSet|o(?:n(?:structor|trollers)|okieEnabled|lorDepth|mp(?:onents|lete))|urrent|puClass|l(?:i(?:p(?:boardData)?|entInformation)|osed|asses)|alle(?:e|r)|rypto)|t(?:o(?:olbar|p)|ext(?:Transform|Indent|Decoration|Align)|ags)|SQRT(?:1_2|2)|i(?:n(?:ner(?:Height|Width)|put)|ds|gnoreCase)|zIndex|o(?:scpu|n(?:readystatechange|Line)|uter(?:Height|Width)|p(?:sProfile|ener)|ffscreenBuffering)|NEGATIVE_INFINITY|d(?:i(?:splay|alog(?:Height|Top|Width|Left|Arguments)|rectories)|e(?:scription|fault(?:Status|Ch(?:ecked|arset)|View)))|u(?:ser(?:Profile|Language|Agent)|n(?:iqueID|defined)|pdateInterval)|_content|p(?:ixelDepth|ort|ersonalbar|kcs11|l(?:ugins|atform)|a(?:thname|dding(?:Right|Bottom|Top|Left)|rent(?:Window|Layer)?|ge(?:X(?:Offset)?|Y(?:Offset)?))|r(?:o(?:to(?:col|type)|duct(?:Sub)?|mpter)|e(?:vious|fix)))|e(?:n(?:coding|abledPlugin)|x(?:ternal|pando)|mbeds)|v(?:isibility|endor(?:Sub)?|Linkcolor)|URLUnencoded|P(?:I|OSITIVE_INFINITY)|f(?:ilename|o(?:nt(?:Size|Family|Weight)|rmName)|rame(?:s|Element)|gColor)|E|whiteSpace|l(?:i(?:stStyleType|n(?:eHeight|kColor))|o(?:ca(?:tion(?:bar)?|lName)|wsrc)|e(?:ngth|ft(?:Context)?)|a(?:st(?:M(?:odified|atch)|Index|Paren)|yer(?:s|X)|nguage))|a(?:pp(?:MinorVersion|Name|Co(?:deName|re)|Version)|vail(?:Height|Top|Width|Left)|ll|r(?:ity|guments)|Linkcolor|bove)|r(?:ight(?:Context)?|e(?:sponse(?:XML|Text)|adyState))|global|x|m(?:imeTypes|ultiline|enubar|argin(?:Right|Bottom|Top|Left))|L(?:N(?:10|2)|OG(?:10E|2E))|b(?:o(?:ttom|rder(?:Width|RightWidth|BottomWidth|Style|Color|TopWidth|LeftWidth))|ufferDepth|elow|ackground(?:Color|Image)))\b/
        }, {
            token : ["storage.type", "punctuation.operator", "support.function.firebug"],
            regex : /(console)(\.)(warn|info|log|error|time|timeEnd|assert)\b/
        }, {
            token : keywordMapper,
            regex : identifierRe
        }, {
            token : "keyword.operator",
            regex : /--|\+\+|[!$%&amp;*+\-~]|===|==|=|!=|!==|&lt;=|&gt;=|&lt;&lt;=|&gt;&gt;=|&gt;&gt;&gt;=|&lt;&gt;|&lt;|&gt;|!|&amp;&amp;|\|\||\?\:|\*=|%=|\+=|\-=|&amp;=|\^=/,

next : “regex_allowed”
}, {
token : “punctuation.operator”,
regex : /\?|:|\,|\;|./,
next : “regex_allowed”
}, {
token : “paren.lparen”,
regex : /[[({]/,
next : “regex_allowed”
}, {
token : “paren.rparen”,
regex : /[])}]/
}, {
token : “keyword.operator”,
regex : /\/=?/,
next : “regex_allowed”
}, {
token: “comment”,
regex: /^#!.$/
}
],
“regex_allowed”: [
DocCommentHighlightRules.getStartRule(“doc-start”),
{
token : “comment”, // multi line comment
regex : “\/\
“,
next : “comment_regex_allowed”
}, {
token : “comment”,
regex : “\/\/.$”
}, {
token: “string.regexp”,
regex: “\/”,
next: “regex”,
}, {
token : “text”,
regex : “\s+”
}, {
token: “empty”,
regex: “”,
next: “start”
}
],
“regex”: [
{
token: “regexp.keyword.operator”,
regex: “\\(?:u[\da-fA-F]{4}|x[\da-fA-F]{2}|.)”
}, {
token: “string.regexp”,
regex: “/\w
“,
next: “start”,
}, {
token : “invalid”,
regex: /{\d+,?(?:\d+)?}[+]|[+$^?][+]|[$^][?]|\?{3,}/
}, {
token : “constant.language.escape”,
regex: /(\?[:=!]|)|{\d+,?(?:\d+)?}|{,\d+}|[+
]\?|[()$^+?]/
}, {
token : “constant.language.delimiter”,
regex: /|/
}, {
token: “constant.language.escape”,
regex: /[\^?/,
next: “regex_character_class”,
}, {
token: “empty”,
regex: “$”,
next: “start”
}, {
defaultToken: “string.regexp”
}
],
“regex_character_class”: [
{
token: “regexp.keyword.operator”,
regex: “\\(?:u[\da-fA-F]{4}|x[\da-fA-F]{2}|.)”
}, {
token: “constant.language.escape”,
regex: “]”,
next: “regex”,
}, {
token: “constant.language.escape”,
regex: “-”
}, {
token: “empty”,
regex: “$”,
next: “start”
}, {
defaultToken: “string.regexp.charachterclass”
}
],
“function_arguments”: [
{
token: “variable.parameter”,
regex: identifierRe
}, {
token: “punctuation.operator”,
regex: “[, ]+”,
}, {
token: “punctuation.operator”,
regex: “$”,
}, {
token: “empty”,
regex: “”,
next: “start”
}
],
“comment_regex_allowed” : [
{token : “comment”, regex : “\
\/”, next : “regex_allowed”},
{defaultToken : “comment”}
],
“comment” : [
{token : “comment”, regex : “\*\/”, next : “start”},
{defaultToken : “comment”}
],
“qqstring” : [
{
token : “constant.language.escape”,
regex : escapedRe
}, {
token : “string”,
regex : “\\$”,
next : “qqstring”,
}, {
token : “string”,
regex : ‘”|$’,
next : “start”,
}, {
defaultToken: “string”
}
],
“qstring” : [
{
token : “constant.language.escape”,
regex : escapedRe
}, {
token : “string”,
regex : “\\$”,
next : “qstring”,
}, {
token : “string”,
regex : “‘|$”,
next : “start”,
}, {
defaultToken: “string”
}
]
};

this.embedRules(DocCommentHighlightRules, “doc-“,
[ DocCommentHighlightRules.getEndRule(“start”) ]);
};

oop.inherits(JavaScriptHighlightRules, TextHighlightRules);

exports.JavaScriptHighlightRules = JavaScriptHighlightRules;
});

ace.define(‘ace/mode/doc_comment_highlight_rules’, [‘require’, ‘exports’, ‘module’ , ‘ace/lib/oop’, ‘ace/mode/text_highlight_rules’], function(require, exports, module) {

var oop = require(“../lib/oop”);
var TextHighlightRules = require(“./text_highlight_rules”).TextHighlightRules;

var DocCommentHighlightRules = function() {

this.$rules = {
“start” : [ {
token : “comment.doc.tag”,
regex : “@[\w\d_]+” // TODO: fix email addresses
}, {
token : “comment.doc.tag”,
regex : “\bTODO\b”
}, {
defaultToken : “comment.doc”
}]
};
};

oop.inherits(DocCommentHighlightRules, TextHighlightRules);

DocCommentHighlightRules.getStartRule = function(start) {
return {
token : “comment.doc”, // doc comment
regex : “\/\(?=\)”,
next : start
};
};

DocCommentHighlightRules.getEndRule = function (start) {
return {
token : “comment.doc”, // closing comment
regex : “\*\/”,
next : start
};
};

exports.DocCommentHighlightRules = DocCommentHighlightRules;

});

ace.define(‘ace/mode/matching_brace_outdent’, [‘require’, ‘exports’, ‘module’ , ‘ace/range’], function(require, exports, module) {

var Range = require(“../range”).Range;

var MatchingBraceOutdent = function() {};

(function() {

this.checkOutdent = function(line, input) {
if (! /^\s+$/.test(line))
return false;

return /^\s*}/.test(input);
};

this.autoOutdent = function(doc, row) {
var line = doc.getLine(row);
var match = line.match(/^(\s*})/);

if (!match) return 0;

var column = match[1].length;
var openBracePos = doc.findMatchingBracket({row: row, column: column});

if (!openBracePos || openBracePos.row == row) return 0;

var indent = this.$getIndent(doc.getLine(openBracePos.row));
doc.replace(new Range(row, 0, row, column-1), indent);
};

this.$getIndent = function(line) {
var match = line.match(/^(\s+)/);
if (match) {
return match[1];
}

return “”;
};

}).call(MatchingBraceOutdent.prototype);

exports.MatchingBraceOutdent = MatchingBraceOutdent;
});

ace.define(‘ace/mode/behaviour/cstyle’, [‘require’, ‘exports’, ‘module’ , ‘ace/lib/oop’, ‘ace/mode/behaviour’, ‘ace/token_iterator’, ‘ace/lib/lang’], function(require, exports, module) {

var oop = require(“../../lib/oop”);
var Behaviour = require(“../behaviour”).Behaviour;
var TokenIterator = require(“../../token_iterator”).TokenIterator;
var lang = require(“../../lib/lang”);

var SAFE_INSERT_IN_TOKENS =
[“text”, “paren.rparen”, “punctuation.operator”];
var SAFE_INSERT_BEFORE_TOKENS =
[“text”, “paren.rparen”, “punctuation.operator”, “comment”];

var autoInsertedBrackets = 0;
var autoInsertedRow = -1;
var autoInsertedLineEnd = “”;
var maybeInsertedBrackets = 0;
var maybeInsertedRow = -1;
var maybeInsertedLineStart = “”;
var maybeInsertedLineEnd = “”;

var CstyleBehaviour = function () {

CstyleBehaviour.isSaneInsertion = function(editor, session) {
var cursor = editor.getCursorPosition();
var iterator = new TokenIterator(session, cursor.row, cursor.column);
if (!this.$matchTokenType(iterator.getCurrentToken() || “text”, SAFE_INSERT_IN_TOKENS)) {
var iterator2 = new TokenIterator(session, cursor.row, cursor.column + 1);
if (!this.$matchTokenType(iterator2.getCurrentToken() || “text”, SAFE_INSERT_IN_TOKENS))
return false;
}
iterator.stepForward();
return iterator.getCurrentTokenRow() !== cursor.row ||
this.$matchTokenType(iterator.getCurrentToken() || “text”, SAFE_INSERT_BEFORE_TOKENS);
};

CstyleBehaviour.$matchTokenType = function(token, types) {
return types.indexOf(token.type || token) > -1;
};

CstyleBehaviour.recordAutoInsert = function(editor, session, bracket) {
var cursor = editor.getCursorPosition();
var line = session.doc.getLine(cursor.row);
if (!this.isAutoInsertedClosing(cursor, line, autoInsertedLineEnd[0]))
autoInsertedBrackets = 0;
autoInsertedRow = cursor.row;
autoInsertedLineEnd = bracket + line.substr(cursor.column);
autoInsertedBrackets++;
};

CstyleBehaviour.recordMaybeInsert = function(editor, session, bracket) {
var cursor = editor.getCursorPosition();
var line = session.doc.getLine(cursor.row);
if (!this.isMaybeInsertedClosing(cursor, line))
maybeInsertedBrackets = 0;
maybeInsertedRow = cursor.row;
maybeInsertedLineStart = line.substr(0, cursor.column) + bracket;
maybeInsertedLineEnd = line.substr(cursor.column);
maybeInsertedBrackets++;
};

CstyleBehaviour.isAutoInsertedClosing = function(cursor, line, bracket) {
return autoInsertedBrackets > 0 &&
cursor.row === autoInsertedRow &&
bracket === autoInsertedLineEnd[0] &&
line.substr(cursor.column) === autoInsertedLineEnd;
};

CstyleBehaviour.isMaybeInsertedClosing = function(cursor, line) {
return maybeInsertedBrackets > 0 &&
cursor.row === maybeInsertedRow &&
line.substr(cursor.column) === maybeInsertedLineEnd &&
line.substr(0, cursor.column) == maybeInsertedLineStart;
};

CstyleBehaviour.popAutoInsertedClosing = function() {
autoInsertedLineEnd = autoInsertedLineEnd.substr(1);
autoInsertedBrackets–;
};

CstyleBehaviour.clearMaybeInsertedClosing = function() {
maybeInsertedBrackets = 0;
maybeInsertedRow = -1;
};

this.add(“braces”, “insertion”, function (state, action, editor, session, text) {
var cursor = editor.getCursorPosition();
var line = session.doc.getLine(cursor.row);
if (text == ‘{‘) {
var selection = editor.getSelectionRange();
var selected = session.doc.getTextRange(selection);
if (selected !== “” && selected !== “{” && editor.getWrapBehavioursEnabled()) {
return {
text: ‘{‘ + selected + ‘}’,
selection: false
};
} else if (CstyleBehaviour.isSaneInsertion(editor, session)) {
if (/[]})]/.test(line[cursor.column])) {
CstyleBehaviour.recordAutoInsert(editor, session, “}”);
return {
text: ‘{}’,
selection: [1, 1]
};
} else {
CstyleBehaviour.recordMaybeInsert(editor, session, “{“);
return {
text: ‘{‘,
selection: [1, 1]
};
}
}
} else if (text == ‘}’) {
var rightChar = line.substring(cursor.column, cursor.column + 1);
if (rightChar == ‘}’) {
var matching = session.$findOpeningBracket(‘}’, {column: cursor.column + 1, row: cursor.row});
if (matching !== null && CstyleBehaviour.isAutoInsertedClosing(cursor, line, text)) {
CstyleBehaviour.popAutoInsertedClosing();
return {
text: ”,
selection: [1, 1]
};
}
}
} else if (text == “\n” || text == “\r\n”) {
var closing = “”;
if (CstyleBehaviour.isMaybeInsertedClosing(cursor, line)) {
closing = lang.stringRepeat(“}”, maybeInsertedBrackets);
CstyleBehaviour.clearMaybeInsertedClosing();
}
var rightChar = line.substring(cursor.column, cursor.column + 1);
if (rightChar == ‘}’ || closing !== “”) {
var openBracePos = session.findMatchingBracket({row: cursor.row, column: cursor.column}, ‘}’);
if (!openBracePos)
return null;

var indent = this.getNextLineIndent(state, line.substring(0, cursor.column), session.getTabString());
var next_indent = this.$getIndent(line);

return {
text: ‘\n’ + indent + ‘\n’ + next_indent + closing,
selection: [1, indent.length, 1, indent.length]
};
}
}
});

this.add(“braces”, “deletion”, function (state, action, editor, session, range) {
var selected = session.doc.getTextRange(range);
if (!range.isMultiLine() && selected == ‘{‘) {
var line = session.doc.getLine(range.start.row);
var rightChar = line.substring(range.end.column, range.end.column + 1);
if (rightChar == ‘}’) {
range.end.column++;
return range;
} else {
maybeInsertedBrackets–;
}
}
});

this.add(“parens”, “insertion”, function (state, action, editor, session, text) {
if (text == ‘(‘) {
var selection = editor.getSelectionRange();
var selected = session.doc.getTextRange(selection);
if (selected !== “” && editor.getWrapBehavioursEnabled()) {
return {
text: ‘(‘ + selected + ‘)’,
selection: false
};
} else if (CstyleBehaviour.isSaneInsertion(editor, session)) {
CstyleBehaviour.recordAutoInsert(editor, session, “)”);
return {
text: ‘()’,
selection: [1, 1]
};
}
} else if (text == ‘)’) {
var cursor = editor.getCursorPosition();
var line = session.doc.getLine(cursor.row);
var rightChar = line.substring(cursor.column, cursor.column + 1);
if (rightChar == ‘)’) {
var matching = session.$findOpeningBracket(‘)’, {column: cursor.column + 1, row: cursor.row});
if (matching !== null && CstyleBehaviour.isAutoInsertedClosing(cursor, line, text)) {
CstyleBehaviour.popAutoInsertedClosing();
return {
text: ”,
selection: [1, 1]
};
}
}
}
});

this.add(“parens”, “deletion”, function (state, action, editor, session, range) {
var selected = session.doc.getTextRange(range);
if (!range.isMultiLine() && selected == ‘(‘) {
var line = session.doc.getLine(range.start.row);
var rightChar = line.substring(range.start.column + 1, range.start.column + 2);
if (rightChar == ‘)’) {
range.end.column++;
return range;
}
}
});

this.add(“brackets”, “insertion”, function (state, action, editor, session, text) {
if (text == ‘[‘) {
var selection = editor.getSelectionRange();
var selected = session.doc.getTextRange(selection);
if (selected !== “” && editor.getWrapBehavioursEnabled()) {
return {
text: ‘[‘ + selected + ‘]’,
selection: false
};
} else if (CstyleBehaviour.isSaneInsertion(editor, session)) {
CstyleBehaviour.recordAutoInsert(editor, session, “]”);
return {
text: ‘[]’,
selection: [1, 1]
};
}
} else if (text == ‘]’) {
var cursor = editor.getCursorPosition();
var line = session.doc.getLine(cursor.row);
var rightChar = line.substring(cursor.column, cursor.column + 1);
if (rightChar == ‘]’) {
var matching = session.$findOpeningBracket(‘]’, {column: cursor.column + 1, row: cursor.row});
if (matching !== null && CstyleBehaviour.isAutoInsertedClosing(cursor, line, text)) {
CstyleBehaviour.popAutoInsertedClosing();
return {
text: ”,
selection: [1, 1]
};
}
}
}
});

this.add(“brackets”, “deletion”, function (state, action, editor, session, range) {
var selected = session.doc.getTextRange(range);
if (!range.isMultiLine() && selected == ‘[‘) {
var line = session.doc.getLine(range.start.row);
var rightChar = line.substring(range.start.column + 1, range.start.column + 2);
if (rightChar == ‘]’) {
range.end.column++;
return range;
}
}
});

this.add(“string_dquotes”, “insertion”, function (state, action, editor, session, text) {
if (text == ‘”‘ || text == “‘”) {
var quote = text;
var selection = editor.getSelectionRange();
var selected = session.doc.getTextRange(selection);
if (selected !== “” && selected !== “‘” && selected != ‘”‘ && editor.getWrapBehavioursEnabled()) {
return {
text: quote + selected + quote,
selection: false
};
} else {
var cursor = editor.getCursorPosition();
var line = session.doc.getLine(cursor.row);
var leftChar = line.substring(cursor.column-1, cursor.column);
if (leftChar == ‘\’) {
return null;
}
var tokens = session.getTokens(selection.start.row);
var col = 0, token;
var quotepos = -1; // Track whether we’re inside an open quote.

for (var x = 0; x < tokens.length; x++) {
token = tokens[x];
if (token.type == “string”) {
quotepos = -1;
} else if (quotepos < 0) {
quotepos = token.value.indexOf(quote);
}
if ((token.value.length + col) > selection.start.column) {
break;
}
col += tokens[x].value.length;
}
if (!token || (quotepos < 0 && token.type !== “comment” && (token.type !== “string” || ((selection.start.column !== token.value.length+col-1) && token.value.lastIndexOf(quote) === token.value.length-1)))) {
if (!CstyleBehaviour.isSaneInsertion(editor, session))
return;
return {
text: quote + quote,
selection: [1,1]
};
} else if (token && token.type === “string”) {
var rightChar = line.substring(cursor.column, cursor.column + 1);
if (rightChar == quote) {
return {
text: ”,
selection: [1, 1]
};
}
}
}
}
});

this.add("string_dquotes", "deletion", function (state, action, editor, session, range) {
    var selected = session.doc.getTextRange(range);
    if (!range.isMultiLine() &amp;&amp; (selected == '"' || selected == "'")) {
        var line = session.doc.getLine(range.start.row);
        var rightChar = line.substring(range.start.column + 1, range.start.column + 2);
        if (rightChar == selected) {
            range.end.column++;
            return range;
        }
    }
});

};

oop.inherits(CstyleBehaviour, Behaviour);

exports.CstyleBehaviour = CstyleBehaviour;
});

ace.define(‘ace/mode/folding/cstyle’, [‘require’, ‘exports’, ‘module’ , ‘ace/lib/oop’, ‘ace/range’, ‘ace/mode/folding/fold_mode’], function(require, exports, module) {

var oop = require(“../../lib/oop”);
var Range = require(“../../range”).Range;
var BaseFoldMode = require(“./fold_mode”).FoldMode;

var FoldMode = exports.FoldMode = function() {};
oop.inherits(FoldMode, BaseFoldMode);

(function() {

this.foldingStartMarker = /(\{|\[)[^\}\]]*$|^\s*(\/\*)/;
this.foldingStopMarker = /^[^\[\{]*(\}|\])|^[\s\*]*(\*\/)/;

this.getFoldWidgetRange = function(session, foldStyle, row) {
    var line = session.getLine(row);
    var match = line.match(this.foldingStartMarker);
    if (match) {
        var i = match.index;

        if (match[1])
            return this.openingBracketBlock(session, match[1], row, i);

        return session.getCommentFoldRange(row, i + match[0].length, 1);
    }

    if (foldStyle !== "markbeginend")
        return;

    var match = line.match(this.foldingStopMarker);
    if (match) {
        var i = match.index + match[0].length;

        if (match[1])
            return this.closingBracketBlock(session, match[1], row, i);

        return session.getCommentFoldRange(row, i, -1);
    }
};

}).call(FoldMode.prototype);

});

ace.define(‘ace/mode/css’, [‘require’, ‘exports’, ‘module’ , ‘ace/lib/oop’, ‘ace/mode/text’, ‘ace/tokenizer’, ‘ace/mode/css_highlight_rules’, ‘ace/mode/matching_brace_outdent’, ‘ace/worker/worker_client’, ‘ace/mode/behaviour/css’, ‘ace/mode/folding/cstyle’], function(require, exports, module) {

var oop = require(“../lib/oop”);
var TextMode = require(“./text”).Mode;
var Tokenizer = require(“../tokenizer”).Tokenizer;
var CssHighlightRules = require(“./css_highlight_rules”).CssHighlightRules;
var MatchingBraceOutdent = require(“./matching_brace_outdent”).MatchingBraceOutdent;
var WorkerClient = require(“../worker/worker_client”).WorkerClient;
var CssBehaviour = require(“./behaviour/css”).CssBehaviour;
var CStyleFoldMode = require(“./folding/cstyle”).FoldMode;

var Mode = function() {
this.$tokenizer = new Tokenizer(new CssHighlightRules().getRules(), “i”);
this.$outdent = new MatchingBraceOutdent();
this.$behaviour = new CssBehaviour();
this.foldingRules = new CStyleFoldMode();
};
oop.inherits(Mode, TextMode);

(function() {

this.foldingRules = "cStyle";

this.getNextLineIndent = function(state, line, tab) {
    var indent = this.$getIndent(line);
    var tokens = this.$tokenizer.getLineTokens(line, state).tokens;
    if (tokens.length &amp;&amp; tokens[tokens.length-1].type == "comment") {
        return indent;
    }

    var match = line.match(/^.*\{\s*$/);
    if (match) {
        indent += tab;
    }

    return indent;
};

this.checkOutdent = function(state, line, input) {
    return this.$outdent.checkOutdent(line, input);
};

this.autoOutdent = function(state, doc, row) {
    this.$outdent.autoOutdent(doc, row);
};

this.createWorker = function(session) {
    var worker = new WorkerClient(["ace"], "ace/mode/css_worker", "Worker");
    worker.attachToDocument(session.getDocument());

    worker.on("csslint", function(e) {
        session.setAnnotations(e.data);
    });

    worker.on("terminate", function() {
        session.clearAnnotations();
    });

    return worker;
};

}).call(Mode.prototype);

exports.Mode = Mode;

});

ace.define(‘ace/mode/css_highlight_rules’, [‘require’, ‘exports’, ‘module’ , ‘ace/lib/oop’, ‘ace/lib/lang’, ‘ace/mode/text_highlight_rules’], function(require, exports, module) {

var oop = require(“../lib/oop”);
var lang = require(“../lib/lang”);
var TextHighlightRules = require(“./text_highlight_rules”).TextHighlightRules;
var supportType = exports.supportType = “animation-fill-mode|alignment-adjust|alignment-baseline|animation-delay|animation-direction|animation-duration|animation-iteration-count|animation-name|animation-play-state|animation-timing-function|animation|appearance|azimuth|backface-visibility|background-attachment|background-break|background-clip|background-color|background-image|background-origin|background-position|background-repeat|background-size|background|baseline-shift|binding|bleed|bookmark-label|bookmark-level|bookmark-state|bookmark-target|border-bottom|border-bottom-color|border-bottom-left-radius|border-bottom-right-radius|border-bottom-style|border-bottom-width|border-collapse|border-color|border-image|border-image-outset|border-image-repeat|border-image-slice|border-image-source|border-image-width|border-left|border-left-color|border-left-style|border-left-width|border-radius|border-right|border-right-color|border-right-style|border-right-width|border-spacing|border-style|border-top|border-top-color|border-top-left-radius|border-top-right-radius|border-top-style|border-top-width|border-width|border|bottom|box-align|box-decoration-break|box-direction|box-flex-group|box-flex|box-lines|box-ordinal-group|box-orient|box-pack|box-shadow|box-sizing|break-after|break-before|break-inside|caption-side|clear|clip|color-profile|color|column-count|column-fill|column-gap|column-rule|column-rule-color|column-rule-style|column-rule-width|column-span|column-width|columns|content|counter-increment|counter-reset|crop|cue-after|cue-before|cue|cursor|direction|display|dominant-baseline|drop-initial-after-adjust|drop-initial-after-align|drop-initial-before-adjust|drop-initial-before-align|drop-initial-size|drop-initial-value|elevation|empty-cells|fit|fit-position|float-offset|float|font-family|font-size|font-size-adjust|font-stretch|font-style|font-variant|font-weight|font|grid-columns|grid-rows|hanging-punctuation|height|hyphenate-after|hyphenate-before|hyphenate-character|hyphenate-lines|hyphenate-resource|hyphens|icon|image-orientation|image-rendering|image-resolution|inline-box-align|left|letter-spacing|line-height|line-stacking-ruby|line-stacking-shift|line-stacking-strategy|line-stacking|list-style-image|list-style-position|list-style-type|list-style|margin-bottom|margin-left|margin-right|margin-top|margin|mark-after|mark-before|mark|marks|marquee-direction|marquee-play-count|marquee-speed|marquee-style|max-height|max-width|min-height|min-width|move-to|nav-down|nav-index|nav-left|nav-right|nav-up|opacity|orphans|outline-color|outline-offset|outline-style|outline-width|outline|overflow-style|overflow-x|overflow-y|overflow|padding-bottom|padding-left|padding-right|padding-top|padding|page-break-after|page-break-before|page-break-inside|page-policy|page|pause-after|pause-before|pause|perspective-origin|perspective|phonemes|pitch-range|pitch|play-during|position|presentation-level|punctuation-trim|quotes|rendering-intent|resize|rest-after|rest-before|rest|richness|right|rotation-point|rotation|ruby-align|ruby-overhang|ruby-position|ruby-span|size|speak-header|speak-numeral|speak-punctuation|speak|speech-rate|stress|string-set|table-layout|target-name|target-new|target-position|target|text-align-last|text-align|text-decoration|text-emphasis|text-height|text-indent|text-justify|text-outline|text-shadow|text-transform|text-wrap|top|transform-origin|transform-style|transform|transition-delay|transition-duration|transition-property|transition-timing-function|transition|unicode-bidi|vertical-align|visibility|voice-balance|voice-duration|voice-family|voice-pitch-range|voice-pitch|voice-rate|voice-stress|voice-volume|volume|white-space-collapse|white-space|widows|width|word-break|word-spacing|word-wrap|z-index”;
var supportFunction = exports.supportFunction = “rgb|rgba|url|attr|counter|counters”;
var supportConstant = exports.supportConstant = “absolute|after-edge|after|all-scroll|all|alphabetic|always|antialiased|armenian|auto|avoid-column|avoid-page|avoid|balance|baseline|before-edge|before|below|bidi-override|block-line-height|block|bold|bolder|border-box|both|bottom|box|break-all|break-word|capitalize|caps-height|caption|center|central|char|circle|cjk-ideographic|clone|close-quote|col-resize|collapse|column|consider-shifts|contain|content-box|cover|crosshair|cubic-bezier|dashed|decimal-leading-zero|decimal|default|disabled|disc|disregard-shifts|distribute-all-lines|distribute-letter|distribute-space|distribute|dotted|double|e-resize|ease-in|ease-in-out|ease-out|ease|ellipsis|end|exclude-ruby|fill|fixed|georgian|glyphs|grid-height|groove|hand|hanging|hebrew|help|hidden|hiragana-iroha|hiragana|horizontal|icon|ideograph-alpha|ideograph-numeric|ideograph-parenthesis|ideograph-space|ideographic|inactive|include-ruby|inherit|initial|inline-block|inline-box|inline-line-height|inline-table|inline|inset|inside|inter-ideograph|inter-word|invert|italic|justify|katakana-iroha|katakana|keep-all|last|left|lighter|line-edge|line-through|line|linear|list-item|local|loose|lower-alpha|lower-greek|lower-latin|lower-roman|lowercase|lr-tb|ltr|mathematical|max-height|max-size|medium|menu|message-box|middle|move|n-resize|ne-resize|newspaper|no-change|no-close-quote|no-drop|no-open-quote|no-repeat|none|normal|not-allowed|nowrap|nw-resize|oblique|open-quote|outset|outside|overline|padding-box|page|pointer|pre-line|pre-wrap|pre|preserve-3d|progress|relative|repeat-x|repeat-y|repeat|replaced|reset-size|ridge|right|round|row-resize|rtl|s-resize|scroll|se-resize|separate|slice|small-caps|small-caption|solid|space|square|start|static|status-bar|step-end|step-start|steps|stretch|strict|sub|super|sw-resize|table-caption|table-cell|table-column-group|table-column|table-footer-group|table-header-group|table-row-group|table-row|table|tb-rl|text-after-edge|text-before-edge|text-bottom|text-size|text-top|text|thick|thin|transparent|underline|upper-alpha|upper-latin|upper-roman|uppercase|use-script|vertical-ideographic|vertical-text|visible|w-resize|wait|whitespace|z-index|zero”;
var supportConstantColor = exports.supportConstantColor = “aqua|black|blue|fuchsia|gray|green|lime|maroon|navy|olive|orange|purple|red|silver|teal|white|yellow”;
var supportConstantFonts = exports.supportConstantFonts = “arial|century|comic|courier|garamond|georgia|helvetica|impact|lucida|symbol|system|tahoma|times|trebuchet|utopia|verdana|webdings|sans-serif|serif|monospace”;

var numRe = exports.numRe = “\-?(?:(?:[0-9]+)|(?:[0-9]*\.[0-9]+))”;
var pseudoElements = exports.pseudoElements = “(\:+)\b(after|before|first-letter|first-line|moz-selection|selection)\b”;
var pseudoClasses = exports.pseudoClasses = “(:)\b(active|checked|disabled|empty|enabled|first-child|first-of-type|focus|hover|indeterminate|invalid|last-child|last-of-type|link|not|nth-child|nth-last-child|nth-last-of-type|nth-of-type|only-child|only-of-type|required|root|target|valid|visited)\b”;

var CssHighlightRules = function() {

var keywordMapper = this.createKeywordMapper({
    "support.function": supportFunction,
    "support.constant": supportConstant,
    "support.type": supportType,
    "support.constant.color": supportConstantColor,
    "support.constant.fonts": supportConstantFonts
}, "text", true);

var base_ruleset = [
    {
        token : "comment", // multi line comment
        regex : "\\/\\*",
        next : "ruleset_comment"
    }, {
        token : "string", // single line
        regex : '["](?:(?:\\\\.)|(?:[^"\\\\]))*?["]'
    }, {
        token : "string", // single line
        regex : "['](?:(?:\\\\.)|(?:[^'\\\\]))*?[']"
    }, {
        token : ["constant.numeric", "keyword"],
        regex : "(" + numRe + ")(ch|cm|deg|em|ex|fr|gd|grad|Hz|in|kHz|mm|ms|pc|pt|px|rad|rem|s|turn|vh|vm|vw|%)"
    }, {
        token : "constant.numeric",
        regex : numRe
    }, {
        token : "constant.numeric",  // hex6 color
        regex : "#[a-f0-9]{6}"
    }, {
        token : "constant.numeric", // hex3 color
        regex : "#[a-f0-9]{3}"
    }, {
        token : ["punctuation", "entity.other.attribute-name.pseudo-element.css"],
        regex : pseudoElements
    }, {
        token : ["punctuation", "entity.other.attribute-name.pseudo-class.css"],
        regex : pseudoClasses
    }, {
        token : keywordMapper,
        regex : "\\-?[a-zA-Z_][a-zA-Z0-9_\\-]*"
    }
  ];

var ruleset = lang.copyArray(base_ruleset);
ruleset.unshift({
    token : "paren.rparen",
    regex : "\\}",
    next:   "start"
});

var media_ruleset = lang.copyArray( base_ruleset );
media_ruleset.unshift({
    token : "paren.rparen",
    regex : "\\}",
    next:   "media"
});

var base_comment = [{
      token : "comment", // comment spanning whole line
      regex : ".+"
}];

var comment = lang.copyArray(base_comment);
comment.unshift({
      token : "comment", // closing comment
      regex : ".*?\\*\\/",
      next : "start"
});

var media_comment = lang.copyArray(base_comment);
media_comment.unshift({
      token : "comment", // closing comment
      regex : ".*?\\*\\/",
      next : "media"
});

var ruleset_comment = lang.copyArray(base_comment);
ruleset_comment.unshift({
      token : "comment", // closing comment
      regex : ".*?\\*\\/",
      next : "ruleset"
});

this.$rules = {
    "start" : [{
        token : "comment", // multi line comment
        regex : "\\/\\*",
        next : "comment"
    }, {
        token: "paren.lparen",
        regex: "\\{",
        next:  "ruleset"
    }, {
        token: "string",
        regex: "@.*?{",
        next:  "media"
    },{
        token: "keyword",
        regex: "#[a-z0-9-_]+"
    },{
        token: "variable",
        regex: "\\.[a-z0-9-_]+"
    },{
        token: "string",
        regex: ":[a-z0-9-_]+"
    },{
        token: "constant",
        regex: "[a-z0-9-_]+"
    }],

    "media" : [ {
        token : "comment", // multi line comment
        regex : "\\/\\*",
        next : "media_comment"
    }, {
        token: "paren.lparen",
        regex: "\\{",
        next:  "media_ruleset"
    },{
        token: "string",
        regex: "\\}",
        next:  "start"
    },{
        token: "keyword",
        regex: "#[a-z0-9-_]+"
    },{
        token: "variable",
        regex: "\\.[a-z0-9-_]+"
    },{
        token: "string",
        regex: ":[a-z0-9-_]+"
    },{
        token: "constant",
        regex: "[a-z0-9-_]+"
    }],

    "comment" : comment,

    "ruleset" : ruleset,
    "ruleset_comment" : ruleset_comment,

    "media_ruleset" : media_ruleset,
    "media_comment" : media_comment
};

};

oop.inherits(CssHighlightRules, TextHighlightRules);

exports.CssHighlightRules = CssHighlightRules;

});

ace.define(‘ace/mode/behaviour/css’, [‘require’, ‘exports’, ‘module’ , ‘ace/lib/oop’, ‘ace/mode/behaviour’, ‘ace/mode/behaviour/cstyle’, ‘ace/token_iterator’], function(require, exports, module) {

var oop = require(“../../lib/oop”);
var Behaviour = require(“../behaviour”).Behaviour;
var CstyleBehaviour = require(“./cstyle”).CstyleBehaviour;
var TokenIterator = require(“../../token_iterator”).TokenIterator;

var CssBehaviour = function () {

this.inherit(CstyleBehaviour);

this.add("colon", "insertion", function (state, action, editor, session, text) {
    if (text === ':') {
        var cursor = editor.getCursorPosition();
        var iterator = new TokenIterator(session, cursor.row, cursor.column);
        var token = iterator.getCurrentToken();
        if (token &amp;&amp; token.value.match(/\s+/)) {
            token = iterator.stepBackward();
        }
        if (token &amp;&amp; token.type === 'support.type') {
            var line = session.doc.getLine(cursor.row);
            var rightChar = line.substring(cursor.column, cursor.column + 1);
            if (rightChar === ':') {
                return {
                   text: '',
                   selection: [1, 1]
                }
            }
            if (!line.substring(cursor.column).match(/^\s*;/)) {
                return {
                   text: ':;',
                   selection: [1, 1]
                }
            }
        }
    }
});

this.add("colon", "deletion", function (state, action, editor, session, range) {
    var selected = session.doc.getTextRange(range);
    if (!range.isMultiLine() &amp;&amp; selected === ':') {
        var line = session.doc.getLine(range.start.row);
        var rightChar = line.substring(range.end.column, range.end.column + 1);
        if (rightChar === ';') {
            range.end.column ++;
            return range;
        }
    }
});

this.add("semicolon", "insertion", function (state, action, editor, session, text) {
    if (text === ';') {
        var cursor = editor.getCursorPosition();
        var line = session.doc.getLine(cursor.row);
        var rightChar = line.substring(cursor.column, cursor.column + 1);
        if (rightChar === ';') {
            return {
               text: '',
               selection: [1, 1]
            }
        }
    }
});

}
oop.inherits(CssBehaviour, CstyleBehaviour);

exports.CssBehaviour = CssBehaviour;
});

ace.define(‘ace/mode/html_highlight_rules’, [‘require’, ‘exports’, ‘module’ , ‘ace/lib/oop’, ‘ace/lib/lang’, ‘ace/mode/css_highlight_rules’, ‘ace/mode/javascript_highlight_rules’, ‘ace/mode/xml_util’, ‘ace/mode/text_highlight_rules’], function(require, exports, module) {

var oop = require(“../lib/oop”);
var lang = require(“../lib/lang”);
var CssHighlightRules = require(“./css_highlight_rules”).CssHighlightRules;
var JavaScriptHighlightRules = require(“./javascript_highlight_rules”).JavaScriptHighlightRules;
var xmlUtil = require(“./xml_util”);
var TextHighlightRules = require(“./text_highlight_rules”).TextHighlightRules;

var tagMap = lang.createMap({
a : ‘anchor’,
button : ‘form’,
form : ‘form’,
img : ‘image’,
input : ‘form’,
label : ‘form’,
script : ‘script’,
select : ‘form’,
textarea : ‘form’,
style : ‘style’,
table : ‘table’,
tbody : ‘table’,
td : ‘table’,
tfoot : ‘table’,
th : ‘table’,
tr : ‘table’
});

var HtmlHighlightRules = function() {
this.$rules = {
start : [{
token : “text”,
regex : “<\!\[CDATA\[“,
next : “cdata”
}, {
token : “xml-pe”,
regex : “<\?.?\?>”
}, {
token : “comment”,
regex : “<\!–“,
next : “comment”
}, {
token : “xml-pe”,
regex : “<\!.
?>”
}, {
token : “meta.tag”,
regex : “<(?=script\b)”,
next : “script”
}, {
token : “meta.tag”,
regex : “<(?=style\b)”,
next : “style”
}, {
token : “meta.tag”, // opening tag
regex : “<\/?”,
next : “tag”
}, {
token : “text”,
regex : “\s+”
}, {
token : “constant.character.entity”,
regex : “(?:&#[0-9]+;)|(?:&#x[0-9a-fA-F]+;)|(?:&[a-zA-Z0-9_:\.-]+;)”
}],

    cdata : [ {
        token : "text",
        regex : "\\]\\]&gt;",

next : “start”
} ],

comment : [ {
token : “comment”,
regex : “.*?–>”,
next : “start”
}, {
defaultToken : “comment”
} ]
};

xmlUtil.tag(this.$rules, “tag”, “start”, tagMap);
xmlUtil.tag(this.$rules, “style”, “css-start”, tagMap);
xmlUtil.tag(this.$rules, “script”, “js-start”, tagMap);

this.embedRules(JavaScriptHighlightRules, “js-“, [{
token: “comment”,
regex: “\/\/.*(?=<\/script>)”,
next: “tag”
}, {
token: “meta.tag”,
regex: “<\/(?=script)”,
next: “tag”
}]);

this.embedRules(CssHighlightRules, "css-", [{
    token: "meta.tag",
    regex: "&lt;\\/(?=style)",
    next: "tag"
}]);

};

oop.inherits(HtmlHighlightRules, TextHighlightRules);

exports.HtmlHighlightRules = HtmlHighlightRules;
});

ace.define(‘ace/mode/xml_util’, [‘require’, ‘exports’, ‘module’ ], function(require, exports, module) {

function string(state) {
return [{
token : “string”,
regex : ‘”‘,
next : state + “_qqstring”
}, {
token : “string”,
regex : “‘”,
next : state + “_qstring”
}];
}

function multiLineString(quote, state) {
return [
{token : “string”, regex : quote, next : state},
{
token : “constant.language.escape”,
regex : “(?:&#[0-9]+;)|(?:&#x[0-9a-fA-F]+;)|(?:&[a-zA-Z0-9_:\.-]+;)”
},
{defaultToken : “string”}
];
}

exports.tag = function(states, name, nextState, tagMap) {
states[name] = [{
token : “text”,
regex : “\s+”
}, {

token : !tagMap ? "meta.tag.tag-name" : function(value) {
        if (tagMap[value])
            return "meta.tag.tag-name." + tagMap[value];
        else
            return "meta.tag.tag-name";
    },
    regex : "[-_a-zA-Z0-9:]+",
    next : name + "_embed_attribute_list" 
}, {
    token: "empty",
    regex: "",
    next : name + "_embed_attribute_list"
}];

states[name + "_qstring"] = multiLineString("'", name + "_embed_attribute_list");
states[name + "_qqstring"] = multiLineString("\"", name + "_embed_attribute_list");

states[name + "_embed_attribute_list"] = [{
    token : "meta.tag.r",
    regex : "/?&gt;",

next : nextState
}, {
token : “keyword.operator”,
regex : “=”
}, {
token : “entity.other.attribute-name”,
regex : “[-_a-zA-Z0-9:]+”
}, {
token : “constant.numeric”, // float
regex : “[+-]?\d+(?:(?:\.\d*)?(?:[eE][+-]?\d+)?)?\b”
}, {
token : “text”,
regex : “\s+”
}].concat(string(name));
};

});

ace.define(‘ace/mode/behaviour/html’, [‘require’, ‘exports’, ‘module’ , ‘ace/lib/oop’, ‘ace/mode/behaviour/xml’, ‘ace/mode/behaviour/cstyle’, ‘ace/token_iterator’], function(require, exports, module) {

var oop = require(“../../lib/oop”);
var XmlBehaviour = require(“../behaviour/xml”).XmlBehaviour;
var CstyleBehaviour = require(“./cstyle”).CstyleBehaviour;
var TokenIterator = require(“../../token_iterator”).TokenIterator;
var voidElements = [‘area’, ‘base’, ‘br’, ‘col’, ‘command’, ’embed’, ‘hr’, ‘img’, ‘input’, ‘keygen’, ‘link’, ‘meta’, ‘param’, ‘source’, ‘track’, ‘wbr’];

function hasType(token, type) {
var hasType = true;
var typeList = token.type.split(‘.’);
var needleList = type.split(‘.’);
needleList.forEach(function(needle){
if (typeList.indexOf(needle) == -1) {
hasType = false;
return false;
}
});
return hasType;
}

var HtmlBehaviour = function () {

this.inherit(XmlBehaviour); // Get xml behaviour

this.add(“autoclosing”, “insertion”, function (state, action, editor, session, text) {
if (text == ‘>’) {
var position = editor.getCursorPosition();
var iterator = new TokenIterator(session, position.row, position.column);
var token = iterator.getCurrentToken();
var atCursor = false;
if (!token || !hasType(token, ‘meta.tag’) && !(hasType(token, ‘text’) && token.value.match(‘/’))){
do {
token = iterator.stepBackward();
} while (token && (hasType(token, ‘string’) || hasType(token, ‘keyword.operator’) || hasType(token, ‘entity.attribute-name’) || hasType(token, ‘text’)));
} else {
atCursor = true;
}
if (!token || !hasType(token, ‘meta.tag-name’) || iterator.stepBackward().value.match(‘/’)) {
return
}
var element = token.value;
if (atCursor){
var element = element.substring(0, position.column – token.start);
}
if (voidElements.indexOf(element) !== -1){
return;
}
return {
text: ‘>’ + ‘‘,
selection: [1, 1]
}
}
});
}
oop.inherits(HtmlBehaviour, XmlBehaviour);

exports.HtmlBehaviour = HtmlBehaviour;
});

ace.define(‘ace/mode/behaviour/xml’, [‘require’, ‘exports’, ‘module’ , ‘ace/lib/oop’, ‘ace/mode/behaviour’, ‘ace/mode/behaviour/cstyle’, ‘ace/token_iterator’], function(require, exports, module) {

var oop = require(“../../lib/oop”);
var Behaviour = require(“../behaviour”).Behaviour;
var CstyleBehaviour = require(“./cstyle”).CstyleBehaviour;
var TokenIterator = require(“../../token_iterator”).TokenIterator;

function hasType(token, type) {
var hasType = true;
var typeList = token.type.split(‘.’);
var needleList = type.split(‘.’);
needleList.forEach(function(needle){
if (typeList.indexOf(needle) == -1) {
hasType = false;
return false;
}
});
return hasType;
}

var XmlBehaviour = function () {

this.inherit(CstyleBehaviour, [“string_dquotes”]); // Get string behaviour

this.add(“autoclosing”, “insertion”, function (state, action, editor, session, text) {
if (text == ‘>’) {
var position = editor.getCursorPosition();
var iterator = new TokenIterator(session, position.row, position.column);
var token = iterator.getCurrentToken();
var atCursor = false;
if (!token || !hasType(token, ‘meta.tag’) && !(hasType(token, ‘text’) && token.value.match(‘/’))){
do {
token = iterator.stepBackward();
} while (token && (hasType(token, ‘string’) || hasType(token, ‘keyword.operator’) || hasType(token, ‘entity.attribute-name’) || hasType(token, ‘text’)));
} else {
atCursor = true;
}
if (!token || !hasType(token, ‘meta.tag-name’) || iterator.stepBackward().value.match(‘/’)) {
return
}
var tag = token.value;
if (atCursor){
var tag = tag.substring(0, position.column – token.start);
}

return {
text: ‘>’ + ‘‘,
selection: [1, 1]
}
}
});

this.add(‘autoindent’, ‘insertion’, function (state, action, editor, session, text) {
if (text == “\n”) {
var cursor = editor.getCursorPosition();
var line = session.doc.getLine(cursor.row);
var rightChars = line.substring(cursor.column, cursor.column + 2);
if (rightChars == ‘?)/;
this._parseTag = function(tag) {

var match = this.tagRe.exec(tag);
var column = this.tagRe.lastIndex || 0;
this.tagRe.lastIndex = 0;

return {
value: tag,
match: match ? match[2] : “”,
closing: match ? !!match[3] : false,
selfClosing: match ? !!match[5] || match[2] == “/>” : false,
tagName: match ? match[4] : “”,
column: match[1] ? column + match[1].length : column
};
};
this._readTagForward = function(iterator) {
var token = iterator.getCurrentToken();
if (!token)
return null;

var value = “”;
var start;

do {
if (token.type.indexOf(“meta.tag”) === 0) {
if (!start) {
var start = {
row: iterator.getCurrentTokenRow(),
column: iterator.getCurrentTokenColumn()
};
}
value += token.value;
if (value.indexOf(“>”) !== -1) {
var tag = this._parseTag(value);
tag.start = start;
tag.end = {
row: iterator.getCurrentTokenRow(),
column: iterator.getCurrentTokenColumn() + token.value.length
};
iterator.stepForward();
return tag;
}
}
} while(token = iterator.stepForward());

return null;
};

this._readTagBackward = function(iterator) {
var token = iterator.getCurrentToken();
if (!token)
return null;

var value = “”;
var end;

do {
if (token.type.indexOf(“meta.tag”) === 0) {
if (!end) {
end = {
row: iterator.getCurrentTokenRow(),
column: iterator.getCurrentTokenColumn() + token.value.length
};
}
value = token.value + value;
if (value.indexOf(“<“) !== -1) {
var tag = this._parseTag(value);
tag.end = end;
tag.start = {
row: iterator.getCurrentTokenRow(),
column: iterator.getCurrentTokenColumn()
};
iterator.stepBackward();
return tag;
}
}
} while(token = iterator.stepBackward());

    return null;
};

this._pop = function(stack, tag) {
    while (stack.length) {

        var top = stack[stack.length-1];
        if (!tag || top.tagName == tag.tagName) {
            return stack.pop();
        }
        else if (this.voidElements[tag.tagName]) {
            return;
        }
        else if (this.voidElements[top.tagName]) {
            stack.pop();
            continue;
        } else {
            return null;
        }
    }
};

this.getFoldWidgetRange = function(session, foldStyle, row) {
    var firstTag = this._getFirstTagInLine(session, row);

    if (!firstTag.match)
        return null;

    var isBackward = firstTag.closing || firstTag.selfClosing;
    var stack = [];
    var tag;

    if (!isBackward) {
        var iterator = new TokenIterator(session, row, firstTag.column);
        var start = {
            row: row,
            column: firstTag.column + firstTag.tagName.length + 2
        };
        while (tag = this._readTagForward(iterator)) {
            if (tag.selfClosing) {
                if (!stack.length) {
                    tag.start.column += tag.tagName.length + 2;
                    tag.end.column -= 2;
                    return Range.fromPoints(tag.start, tag.end);
                } else
                    continue;
            }

            if (tag.closing) {
                this._pop(stack, tag);
                if (stack.length == 0)
                    return Range.fromPoints(start, tag.start);
            }
            else {
                stack.push(tag)
            }
        }
    }
    else {
        var iterator = new TokenIterator(session, row, firstTag.column + firstTag.match.length);
        var end = {
            row: row,
            column: firstTag.column
        };

        while (tag = this._readTagBackward(iterator)) {
            if (tag.selfClosing) {
                if (!stack.length) {
                    tag.start.column += tag.tagName.length + 2;
                    tag.end.column -= 2;
                    return Range.fromPoints(tag.start, tag.end);
                } else
                    continue;
            }

            if (!tag.closing) {
                this._pop(stack, tag);
                if (stack.length == 0) {
                    tag.start.column += tag.tagName.length + 2;
                    return Range.fromPoints(tag.start, end);
                }
            }
            else {
                stack.push(tag)
            }
        }
    }

};

}).call(FoldMode.prototype);

});