Article: Eight Reasons to use JScript
Forum rules
Do not post any licensing information in this forum.
Any code longer than three lines should be added as code using the 'Select Code' dropdown menu or attached as a file.
Do not post any licensing information in this forum.
Any code longer than three lines should be added as code using the 'Select Code' dropdown menu or attached as a file.
Article: Eight Reasons to use JScript
Hi all,I've published an article titled Eight Reasons Windows Administrators Should Learn JScript Instead of VBScript on O'Reilly's windowsdevcenter.com site. I'd love to hear any feedback.Thanks!Bill
Article: Eight Reasons to use JScript
Hi all,I've published an article titled Eight Reasons Windows Administrators Should Learn JScript Instead of VBScript on O'Reilly's windowsdevcenter.com site. I'd love to hear any feedback.Thanks!Bill
Article: Eight Reasons to use JScript
Hi Jeff,Thanks for your feedback.PowerShell is an important innovation and a fresh perspective on management, but I still think that it exists in a slightly different problem space than WSH, even though it is designed to solve some of the same problems. It's still important to be able to manage the lowest common denominator (e.g., Cmd.exe shell scripting is still in use).For example, I wouldn't (yet) try to write logon scripts using PowerShell scripts unless you have a very standardized network where you can guarantee that .NET 2.0 and PowerShell are already installed on every machine that might potentially run the script.For new (and even experienced) script authors, yes, I definitely recommend learning
PowerShell. But since WSH and HTAs are still viable, I recommend
learning how to use them also, but I recommend JScript rather than
VBScript. I particularly recommend writing HTAs with JScript, because since it's JavaScript you've just extended your resume to include writing client-side web browser code. (And I don't forsee PowerShell being a client-side web browser language, at least not any time soon.)Bill
PowerShell. But since WSH and HTAs are still viable, I recommend
learning how to use them also, but I recommend JScript rather than
VBScript. I particularly recommend writing HTAs with JScript, because since it's JavaScript you've just extended your resume to include writing client-side web browser code. (And I don't forsee PowerShell being a client-side web browser language, at least not any time soon.)Bill
Article: Eight Reasons to use JScript
Bill
Yes I agree mostly. JScript is much better for designing complex code structures and has great support for exception handling.
The biggest drawback for many admins is a lack of any formal training in programming. JScript is a more technical language by design and does require a fairly long and initially steep learning curve whereas VBScript is more easily assimilated.
For simple admin scripting VB is the chioice language due to the above. Larger and moer complex problems sometimes can be more easily solved with JScript.
My rag on both of these languages is that they were initially built to support browsers and were poorly poted to WSH. Othe WSH languages are much more powerful than either VB or JS.
Now if JS was as well done as Java we might have something. Of course yo ucan use Java as an admin tool bu it requires some mucking with teh engine security settings to get it to work in all cases.
Anyway - excellent article. I will keep it for reference when I think someone is trying to solve World Hunger with a pocket knife. JScriptis more like a Bowie Knife.
Yes I agree mostly. JScript is much better for designing complex code structures and has great support for exception handling.
The biggest drawback for many admins is a lack of any formal training in programming. JScript is a more technical language by design and does require a fairly long and initially steep learning curve whereas VBScript is more easily assimilated.
For simple admin scripting VB is the chioice language due to the above. Larger and moer complex problems sometimes can be more easily solved with JScript.
My rag on both of these languages is that they were initially built to support browsers and were poorly poted to WSH. Othe WSH languages are much more powerful than either VB or JS.
Now if JS was as well done as Java we might have something. Of course yo ucan use Java as an admin tool bu it requires some mucking with teh engine security settings to get it to work in all cases.
Anyway - excellent article. I will keep it for reference when I think someone is trying to solve World Hunger with a pocket knife. JScriptis more like a Bowie Knife.
Article: Eight Reasons to use JScript
Hi jvierra,Thanks for your comments. Naturally, I think that it makes more sense to learn JScript, even for non-programmers, because I think it adds more to their repertoire than VBScript.Thanks!Bill
Article: Eight Reasons to use JScript
Agreed.
It's interesting to note that for a very large number of internal scripts MS uses JScript. They also have a pretty good set of JS functionlibraries that are used in many products.
It's interesting to note that for a very large number of internal scripts MS uses JScript. They also have a pretty good set of JS functionlibraries that are used in many products.
Article: Eight Reasons to use JScript
The MS product analysis tools use jscript for some components and versions. YOu can download the tools at ms downloads I believe.
From teh MS installer packages ( search %windir% for "*.js" you;ll find a ton of scripts.
From teh MS installer packages ( search %windir% for "*.js" you;ll find a ton of scripts.
Code: Select all
function ErrorSkipBtnHandler(){ if (InActivation_AppMode()) { window.external.Hangup(); ShowIFrame('False'); window.setTimeout("ExitWPA();",1000); } else { window.external.Hangup(); PopCKPT(); GoCancel(); }}
function DialErrorNextBtnHandler() { GoToDialingPage();}
function CnncterrNextBtnHandler() { if (g.Callwait != null) { TapiObj.set_CallWaiting = g.Callwait.value; } window.external.set_DialAlternative(false); DialErrorNextBtnHandler();}
var L_EnterValidPhoneNumber_Text = "Cannot delete entire phone number.";function CheckPhoneNumer(phoneNumber){ if (phoneNumber.length == 0) { return false; } return true;}
function ToobusyNextBtnHandler() { window.external.set_DialAlternative(true);
if (!(g.DialRuleYes.checked)) { TapiObj.set_DialOut(g.edtOutsideLine.value); TapiObj.set_CallWaiting(g.edtCallWaiting.value); } if (g.DialTone.checked) { TapiObj.set_PhoneSystem(1); } else { TapiObj.set_PhoneSystem(0); }
DialErrorNextBtnHandler();}
var gTooBusyHaveError1 = false;var gTooBusyHaveError2 = false;var gTooBusyHaveError3 = false;
var L_altnumber_Text = "<u>D</u>ial this alternate number:";var L_altnumber01_Text = "* <u>D</u>ial this alternate number:";var L_outsideline_Text = "Include this number to get an <u>o</u>utside line:";var L_outsideline01_Text = "* Include this number to get an <u>o</u>utside line:";var L_callwaiting_Text = "Disable <u>c</u>all waiting:";var L_callwaiting01_Text = "* Disable <u>c</u>all waiting:";
function NewToobusyNextBtnHandler() { gTooBusyHaveError1 = false; gTooBusyHaveError2 = false; gTooBusyHaveError3 = false; g.tberrspan1.style.visibility = "hidden"; g.tberrspan2.style.visibility = "hidden"; g.tberrspan3.style.visibility = "hidden";
if (g.cb_altnumber.checked) { g_AltnumberHolder = g.edt_altnumber.value; window.external.set_DialNumber(g.edt_altnumber.value);
if (g.edt_altnumber.value != "") { g.lbl_altnumber.innerHTML = L_altnumber_Text; g.lbl_altnumber.className = "text-primary"; } else { gTooBusyHaveError1 = true; g.lbl_altnumber.innerHTML = L_altnumber01_Text; g.lbl_altnumber.className = "text-error"; } } else { g_AltnumberHolder = ""; window.external.set_DialAlternative(true); }
if (g.cb_outsideline.checked) { g_OutsidelineHolder = g.edt_outsideline.value; TapiObj.set_DialOut(g.edt_outsideline.value);
if (g.edt_outsideline.value != "") { g.lbl_outsideline.innerHTML = L_outsideline_Text; g.lbl_outsideline.className = "text-primary"; } else { gTooBusyHaveError2 = true; g.lbl_outsideline.innerHTML = L_outsideline01_Text; g.lbl_outsideline.className = "text-error"; } } else { g_OutsidelineHolder = ""; TapiObj.set_DialOut(g.edt_outsideline.value); }
if (g.cb_callwaiting.checked) { g_CallwaitingHolder = g.edt_callwaiting.value; TapiObj.set_CallWaiting(g.edt_callwaiting.value);
if (g.edt_callwaiting.value != "") { g.lbl_callwaiting.innerHTML = L_callwaiting_Text; g.lbl_callwaiting.className = "text-primary"; } else { gTooBusyHaveError3 = true; g.lbl_callwaiting.innerHTML = L_callwaiting01_Text; g.lbl_callwaiting.className = "text-error"; } } else { g_CallwaitingHolder = ""; TapiObj.set_CallWaiting(g.edt_callwaiting.value); }
if (g.DialTone.checked) { TapiObj.set_PhoneSystem(1); } else { TapiObj.set_PhoneSystem(0); }
if ((gTooBusyHaveError1) || (gTooBusyHaveError2) || (gTooBusyHaveError3)) NewToobusy_LoadMe(); else DialErrorNextBtnHandler(); }
function TelError_TelephoneBtnHandler() { PopCKPT(); GoNavigate(CKPT_ACTIVSVC)}
function Enable_TelBtn_ActMode(){ if (InActivation_AppMode()) { GetPageTitle();
g.btnTelephone.style.display = "inline"; g.btnTelephone.onmouseover = HandleButtonMouseOver; g.btnTelephone.onmouseout = HandleButtonMouseOut; g.btnTelephone.onclick = TelError_TelephoneBtnHandler;
var L_RemindMeLater_Text = "To continue without performing this task, click <b>Remind me later</b>."; g.RemindMeLaterText.innerHTML = L_RemindMeLater_Text; var L_RemindMeLater01_Text = " Re<u>m</u>ind me later "; var AccesskeyRemind_M = "M"; g.btnSkip.innerHTML = L_RemindMeLater01_Text; g.btnSkip.accessKey = AccesskeyRemind_M; }}
function DefaultErr_LoadMe(){ InitFrameRef();
if (APP_MSN_MODE == window.external.Directions.get_AppMode()) { var spanCollection = g.document.body.getElementsByTagName("span"); if (spanCollection != 0) { for (var i = 0; i < spanCollection.length; i++) { if (spanCollection.className == "text-primary-btndesc") { var styleObj = spanCollection.style; styleObj.position = "relative"; styleObj.top = "0"; styleObj.left = "0"; } } } }
InitButtons();
try { if(g.btnRestore != null) { if (InReminderMode()) { g.btnRestore.onmouseover = HandleButtonMouseOver; g.btnRestore.onmouseout = HandleButtonMouseOut; g.btnRestore.className="buttons"; } else { g.btnRestore.onmouseover = HandleNextButtonMouseOver; g.btnRestore.onmouseout = HandleNextButtonMouseOut; g.btnRestore.onmousedown = HandleNextButtonMouseDown; g.btnRestore.className="newbuttonsNext"; } } } catch (e) {}
Enable_TelBtn_ActMode();
g.btnNext.focus(); window.external.set_DialAlternative(false); g.btnNext.onclick = DialErrorNextBtnHandler; g.btnSkip.onclick = ErrorSkipBtnHandler;}
function Cnncterr_LoadMe(){ DefaultErr_LoadMe(); g.btnNext.onclick = CnncterrNextBtnHandler; if (g.Callwait != null) g.Callwait.value = TapiObj.get_CallWaiting;}
var g_AltnumberHolder = null;var g_OutsidelineHolder = null;var g_CallwaitingHolder = null;
function Toobusy_LoadMe(){ DefaultErr_LoadMe(); g.spanDisplayNumber.innerText = window.external.get_DialNumber; g.edtOutsideLine.value = TapiObj.get_DialOut; g.edtCallWaiting.value = TapiObj.get_CallWaiting; if (1 == TapiObj.get_PhoneSystem) { g.DialTone.checked = true; } else { g.DialPulse.checked = true; } g.btnNext.onclick = ToobusyNextBtnHandler; SelectDialRule();}
function NewToobusy_LoadMe(){ DefaultErr_LoadMe();
var L_tbstr1_Text = "Setup cannot connect to this number to activate and register your computer."; var L_tbstr2_Text = "Setup cannot connect to this number to activate your computer."; var L_tbstr3_Text = "Setup cannot connect to this number to register your computer.";
var L_tbstr4_Text = "To continue without activating and registering your computer, click <b>Skip</b>."; var L_tbstr5_Text = "To continue without activating your computer, click <b>Skip</b>."; var L_tbstr6_Text = "To continue without registering your computer, click <b>Skip</b>."; if (g_DoActivation) { if ((g_PostToMS) || (g_PostToOEM)) { g.tbpar1.innerHTML = L_tbstr1_Text; g.tbpar2.innerHTML = L_tbstr4_Text; } else { g.tbpar1.innerHTML = L_tbstr2_Text; g.tbpar2.innerHTML = L_tbstr5_Text; } } else { g.tbpar1.innerHTML = L_tbstr3_Text; g.tbpar2.innerHTML = L_tbstr6_Text; }
var fLoadPhoneNumber = window.external.get_DialNumber; g.spanDisplayNumber.innerHTML = " <B>" + fLoadPhoneNumber + "</B>";
if (gTooBusyHaveError1) g.tberrspan1.style.visibility = "visible"; if (gTooBusyHaveError2) g.tberrspan2.style.visibility = "visible"; if (gTooBusyHaveError3) g.tberrspan3.style.visibility = "visible";
if (((g_AltnumberHolder == null) || (g_AltnumberHolder == "")) && (!gTooBusyHaveError1)) { g_AltnumberHolder = ""; g.edt_altnumber.value = ""; g.edt_altnumber.style.backgroundColor = "#dddddd"; g.edt_altnumber.style.disabled = true; g.cb_altnumber.checked = false; } else { g.edt_altnumber.disabled = false; g.edt_altnumber.value = g_AltnumberHolder; g.edt_altnumber.style.backgroundColor = "#ffffff"; g.cb_altnumber.checked = true; }
if (!gTooBusyHaveError2) g_OutsidelineHolder = TapiObj.get_DialOut;
if (((g_OutsidelineHolder == null) || (g_OutsidelineHolder == "")) && (!gTooBusyHaveError2)) { g_OutsidelineHolder = ""; g.edt_outsideline.value = ""; g.edt_outsideline.style.backgroundColor = "#dddddd"; g.edt_outsideline.disabled = true; g.cb_outsideline.checked = false; } else { g.edt_outsideline.disabled = false; g.edt_outsideline.value = g_OutsidelineHolder; g.edt_outsideline.style.backgroundColor = "#ffffff"; g.cb_outsideline.checked = true; }
if (!gTooBusyHaveError3) g_CallwaitingHolder = TapiObj.get_CallWaiting;
if (((g_CallwaitingHolder == null) || (g_CallwaitingHolder == "")) && (!gTooBusyHaveError3)) { g_CallwaitingHolder = ""; g.edt_callwaiting.value = ""; g.edt_callwaiting.style.backgroundColor = "#dddddd"; g.edt_callwaiting.disabled = true; g.cb_callwaiting.checked = false; } else { g.edt_callwaiting.disabled = false; g.edt_callwaiting.value = g_CallwaitingHolder; g.edt_callwaiting.style.backgroundColor = "#ffffff"; g.cb_callwaiting.checked = true; }
if (1 == TapiObj.get_PhoneSystem) { g.DialTone.checked = true; } else { g.DialPulse.checked = true; }
g.btnNext.onclick = NewToobusyNextBtnHandler;}
function Check_cb_altnumber(){ if (g.cb_altnumber.checked == true) { g.edt_altnumber.style.backgroundColor = "#ffffff"; g.edt_altnumber.disabled = false; g.edt_altnumber.value = g_AltnumberHolder; g.edt_altnumber.focus(); } else { g_AltnumberHolder = g.edt_altnumber.value; g.edt_altnumber.value = ""; g.edt_altnumber.style.backgroundColor = "#dddddd"; g.edt_altnumber.disabled = true; g.lbl_altnumber.innerHTML = L_altnumber_Text; g.lbl_altnumber.className = "text-primary"; }}
function Check_cb_outsideline(){ if (g.cb_outsideline.checked == true) { g.edt_outsideline.style.backgroundColor = "#ffffff"; g.edt_outsideline.disabled = false; g.edt_outsideline.value = g_OutsidelineHolder; g.edt_outsideline.focus(); } else { g_OutsidelineHolder = g.edt_outsideline.value; g.edt_outsideline.value = ""; g.edt_outsideline.style.backgroundColor = "#dddddd"; g.edt_outsideline.disabled = true; g.lbl_outsideline.innerHTML = L_outsideline_Text; g.lbl_outsideline.className = "text-primary"; }}
function Check_cb_callwaiting(){ if (g.cb_callwaiting.checked == true) { g.edt_callwaiting.style.backgroundColor = "#ffffff"; g.edt_callwaiting.disabled = false; g.edt_callwaiting.value = g_CallwaitingHolder; g.edt_callwaiting.focus(); } else { g_CallwaitingHolder = g.edt_callwaiting.value; g.edt_callwaiting.value = ""; g.edt_callwaiting.style.backgroundColor = "#dddddd"; g.edt_callwaiting.disabled = true; g.lbl_callwaiting.innerHTML = L_callwaiting_Text; g.lbl_callwaiting.className = "text-primary"; }}
function SelectDialRule(){ if (g.DialRuleYes.checked) { if (g.edtPhoneNumber) g.edtPhoneNumber.disabled=false; g.edtOutsideLine.disabled=true; g.edtCallWaiting.disabled=true; } else { if (g.edtPhoneNumber) g.edtPhoneNumber.disabled=true; g.edtOutsideLine.disabled=false; g.edtCallWaiting.disabled=false; }}
function RestoreDialRule(){ g.spanDisplayNumber.innerText = window.external.get_DialNumber; if (g.edtPhoneNumber) g.edtPhoneNumber.value = window.external.get_PhBkNumber; g.edtOutsideLine.value = TapiObj.get_DialOut; g.edtCallWaiting.value = TapiObj.get_CallWaiting; if (1 == TapiObj.get_PhoneSystem) { g.DialTone.checked = true; } else { g.DialPulse.checked = true; }}
function ISPInsError_NextBtnHandler() { PopCKPT(); GoNavigate(CKPT_OEMCUST);}function ISPInsError_LoadMe(){ DefaultErr_LoadMe(); g.ins_ISPName1.innerText = window.external.get_ISPName; g.ins_ISPName2.innerText = window.external.get_ISPName; g.btnNext.onclick = ISPInsError_NextBtnHandler;}
function NoAnswNextBtnHandler() { if (g.DialTone.checked) { TapiObj.set_PhoneSystem(1); } else { TapiObj.set_PhoneSystem(0); } if (g.DialRuleYes.checked) { if (CheckPhoneNumer(g.edtPhoneNumber.value)) { window.external.set_DialNumber(g.edtPhoneNumber.value); DialErrorNextBtnHandler(); } else { g.edtPhoneNumber.value = window.external.get_DialNumber; g.error_mesg.innerHTML = L_EnterValidPhoneNumber_Text; g.error_mesg.style.display="inline"; } } else { TapiObj.set_DialOut(g.edtOutsideLine.value); TapiObj.set_CallWaiting(g.edtCallWaiting.value); window.external.set_DialAlternative(false); DialErrorNextBtnHandler(); }
}
function NoAnsw_LoadMe(){ DefaultErr_LoadMe(); g.spanDisplayNumber.innerText = window.external.get_DialNumber; g.edtPhoneNumber.value = g.spanDisplayNumber.innerText; g.edtOutsideLine.value = TapiObj.get_DialOut; g.edtCallWaiting.value = TapiObj.get_CallWaiting; if (1 == TapiObj.get_PhoneSystem) { g.DialTone.checked = true; } else { g.DialPulse.checked = true; }
g.btnNext.onclick = NoAnswNextBtnHandler; SelectDialRule();
}
function NoModemBtnHandler() { window.external.Finish();}function NoModem_LoadMe(){ DefaultErr_LoadMe(); g.btnNext.onclick = NoModemBtnHandler;}
function Pulse_LoadMe(){ DefaultErr_LoadMe(); if (1 == TapiObj.set_PhoneSystem) g.tone.checked = true; else g.pulse.checked = true;}
function DesktopPbErr_LoadMe(){ InitFrameRef(); if (InActivation_AppMode()) { GetPageTitle(); }
InitButtons();
var L_DeskpbErrOEMName_Text = g_OEMNameStr; if (L_DeskpbErrOEMName_Text == "") { L_DeskpbErrOEMName_Text = L_MissingOEMName_Text; }
var L_DeskMainPBerrMsg_Text = "";
if (g_DoActivation) { if ((g_PostToMS) && (g_PostToOEM)) { L_DeskMainPBerrMsg_Text = "Online registration and activation are currently unavailable in your country or region. To register your computer without an Internet connection, please contact %1. You can activate your copy of Windows using an Internet connection or by contacting Microsoft over the telephone."; g.Desktoppberr_par1.innerText = ApiObj.FormatMessage(L_DeskMainPBerrMsg_Text, L_DeskpbErrOEMName_Text); } else if ((g_PostToMS) && (!g_PostToOEM)) { g.Title_Text.innerText = "Unable to activate and register online"; GetPageTitle(); L_DeskMainPBerrMsg_Text = "Online registration and activation are currently unavailable in your country or region. You can activate your copy of Windows using an Internet connection or by contacting Microsoft by telephone. An Internet connection is needed to register your copy of Windows with Microsoft."; g.Desktoppberr_par1.innerText = L_DeskMainPBerrMsg_Text; } else if ((!g_PostToMS) && (g_PostToOEM)) { L_DeskMainPBerrMsg_Text = "Online activation is currently unavailable in your country or region. You can activate your copy of Windows using an Internet connection or by contacting Microsoft by telephone. To register your computer without an Internet connection, please contact %1."; g.Desktoppberr_par1.innerText = ApiObj.FormatMessage(L_DeskMainPBerrMsg_Text, L_DeskpbErrOEMName_Text); } else { g.Title_Text.innerText = "Unable to activate online"; GetPageTitle(); L_DeskMainPBerrMsg_Text = "Online activation is currently unavailable in your country or region. You can activate your copy of Windows using an Internet connection or by contacting Microsoft over the telephone."; g.Desktoppberr_par1.innerText = L_DeskMainPBerrMsg_Text; } } else { if ((!g_PostToMS) && (g_PostToOEM)) { g.Title_Text.innerText = "Unable to register online"; GetPageTitle(); L_DeskMainPBerrMsg_Text = "Online registration is currently unavailable in your country or region. To register your computer without an Internet connection, please contact %1."; g.Desktoppberr_par1.innerText = ApiObj.FormatMessage(L_DeskMainPBerrMsg_Text, L_DeskpbErrOEMName_Text); } }
g.btnBack.focus(); g.btnBack.onclick = window.parent.SimpleNavBack;}
[code]
Look in: "C:WINDOWSPCHEALTHHELPCTRSystemscripts"
If you search Program Files you will see that5 most vendors use JS for utilities.
Even Java uses JavaScript files on Windows to bootstrap around the Java package at times. The Java VM from MS may not be available but teh JScript engine is always available from W2K and after.
This huge library of sscripts is a very good place to find examples of how to accomplish some pretty tricky tasks.
I am also a big fan of running mixed JScript and VBScript librari3es which can be accomplished in numerous ways. These libraries can alos be called intop from PowerShell with little effort. No code has been left unturned. No rock has been lost. PoSH has made arrangements for it all it seems.
If you look at the older MSDN library WMI examples which may be, now, only available in teh archive, you will see that most of the early examples were written in mostly JScript with only a few in VBScript. In the last three or four years the language has been almost exclusively VBScript.
I don't believe this is MS pushing VBS. Actually it seems that MS has been trying to kill VB for some time - they failed - and have decided to move to VBS only b3ecause it is easier for most admins to become proficient at in a very short time. I also suspect that they are leverage the very large number of VB programmers currently being put out of work due to teh switch to NET and C#.
In my opinion, the lone term outlook for VB and Java dialects looks terminal. Windows will move almost completely to PoSH in the next five years and most web sites will be done with XAML or other declaritive languages. This is the trend that started with C++ and Template languages and is the correct direction to go in. The progreamming is cleaner and portable or will be. Only the OS and it's brethren will be built in C/C++ and newer lower level langugaes. Much help will come from Domain Specific Languages that target a specific OS or OS layer.
My predictions for 2010.
As for JS...itr will still be in use for the next five years and probably beyond. DOS Batch-like shells that actually pre-dates the PC by about 20 years are still with us!!!
Article: Eight Reasons to use JScript
Bill
Just decided to check some of my systems. MPS Reports (%windir%MPSReports) no longer use much scrip and what is used is vbscript.
Note that MPSReports is a good place to see how MS collects information about a platforms oinstallation status and state using a completely stand-alone commandline program set.
Pay close attention to "commands.txt".
Run a report and look at the amount of information packaged into a cab file that is returned.
This is the file that MS support will sometimes ask for when troubleshooting a sticky issue. I have learned to use it as a first line of defense when normal checks failed to find the issue. It's better than anything we could cobble together quickly. I believe MS runs the reports through some analysis tools which summarize known issues and obvious mis-configs or other obvious errors. The output CAB can be 30 Mb or more on a large server.
Just decided to check some of my systems. MPS Reports (%windir%MPSReports) no longer use much scrip and what is used is vbscript.
Note that MPSReports is a good place to see how MS collects information about a platforms oinstallation status and state using a completely stand-alone commandline program set.
Pay close attention to "commands.txt".
Run a report and look at the amount of information packaged into a cab file that is returned.
This is the file that MS support will sometimes ask for when troubleshooting a sticky issue. I have learned to use it as a first line of defense when normal checks failed to find the issue. It's better than anything we could cobble together quickly. I believe MS runs the reports through some analysis tools which summarize known issues and obvious mis-configs or other obvious errors. The output CAB can be 30 Mb or more on a large server.
Article: Eight Reasons to use JScript
Microsoft would say PowerShell is more like C# or maybe PHP <grin>... but you're right; the JScript syntax is much closer to PowerShell's than VBScript's syntax. A good - and interesting - observation.
Article: Eight Reasons to use JScript
Hi shakeer42675,Thanks for your observations. I found that once I started using JScript, VBScript just felt much more awkward to use (of course, this is just my subjective experience). Since PowerShell's scripting language is more like JScript than VBScript, I think it makes more sense to use JScript. JScript also has some language advantages, which I pointed out in the article.Regards,Bill