We are currenly using bat/cmd files to execute jobs, examine a return code and based on the return code execute the next sequence.
I am thinking that .VBS extensioned files may give us a richer language for doing this kind of thing than batch files.
If this is correct, why would someone choose bat files over VBS files? Are VBS files considered “Windows Scripting Host” files? how is this related to Powershell?
Sorry, I am a bit ignorant on my options and the differences.
Writing batch files was powerfull, it still persist nowdays, in fact people are still maintaining batch but it’s old fashion.
A few years ago Microsoft introduced Windows Script Host, which is an infrastructure of scripting languages that allows the writing of Visual Basic or Java scripts. This infrastructure allowed scripters to interact with COM objects and in so doing access to almost everything in Windows. (edited) according to @EBGreen remark, WSH is present from W2K to W2K8 R2
In 2006 Microsoft introduced PowerShell. This scripting environment works on the top of the .Net framework. This means that the PowerShell scripter is able to do most of the things a C# prorammer does. The difference with VBS is that PowerShell is more concise and more coherent than VBS because everything is done using .NET types. Powershell is procedural programming using objects (properties and methods). (edited) according to @EBGreen remark, PowerShell V1.0 is present in Vista and W2K8 and PowerShell V2.0 is present in Windows 7 and W2K8 R2. Powershell 2.0 can be deployed begining on Windows XP SP2.
As far as process control is concern, with powershell you can start, stop, wait for the end of a process.