Alex Rivera | Logout

Advice for Windows XP Scripting, WSH versus PowerShell

Asked 2009-04-06T19:49:55.917
10

After much experience scripting in the Unix/Linux open-source world, using languages such as Bourne Shell, Perl, Python, and Ruby, I now find myself needing to do some Windows XP administration scripting. It appears that the legacy environment is Windows Script Host (WSH), which can use various scripting languages, but the primary language is VBScript, and is based on COM objects. However, the future appears to be Windows PowerShell, which is based on .NET.

I haven't done Basic since Applesoft in the 1970s, so I'm not keen on learning VBScript, although I did learn enough to write a small script to mount network drives. If I'm going to spend time to really learn this, I'm leaning towards investing my time in the .NET PowerShell environment, if it truly is the future. I did some C# Windows Forms programming a couple of years ago, so I have some exposure to .NET, which also makes PowerShell attractive.

Understanding that no one has a crystal ball to predict the future of Microsoft, I would like hear from anyone who is a PowerShell user and thinks it's worthwhile, or if there is anyone that knows of serious drawbacks to PowerShell, and recommends that I stay away from it.

Update: I ended up using WSH/VBScript for a particular script that I am installing as a startup script on user's Windows XP workstations. All I have to do is copy it to their Startup folder, and I'm done. However, I only learned enough WSH to accomplish this one job. I am glad to see that PowerShell is the future, and when I have more complicated scripting tasks, I'll turn to PowerShell.

Edit
Report

1 Answer

3

The main advantage of WSH is that it's been installed by default since Windows 98, possibly even Windows 95, but as PowerShell comes with Server 2008 now, and is installable on anything after XP, it's becoming less of an issue.

If you have full control over the servers which your scripts will run on, I'd recommend going with PowerShell.

answered 2009-04-06T20:27:22.970

Your Answer