bishopsgarthstockton Posted July 9, 2007 Posted July 9, 2007 Hi, I would like to learn how to write vbs programs so i can automate tasks etc on servers and workstations. I have little programing experience, wrote the odd bat file but thats about it. Does any one know of a good book that could help get me started, or know of any free learning material on the web? cheers
strawberry Posted July 9, 2007 Posted July 9, 2007 for dummies is always a good place to start i find, and always great for a reference once your past the dummy stage.
Ric_ Posted July 9, 2007 Posted July 9, 2007 http://www.microsoft.com/technet/scriptcenter/default.mspx
Diello Posted July 9, 2007 Posted July 9, 2007 Personally I wouldn't bother learning VBS now, it's been superceded by PowerShell, and will be the foundation scripting lang, command line, and basis for future MS OS's & server apps, as well as working with current versions. Might as well learn the latest stuff. I'd recommend Don Jones's 'Windows PowerShell: TFM' http://www.amazon.co.uk/Windows-PowerShell-TFM-Don-Jones/dp/0977659720/ref=sr_1_7/026-2613378-9023648?ie=UTF8&s=books&qid=1183984272&sr=8-7 If you really want to go down the VBS route though - try http://www.amazon.co.uk/Microsoft-VBScript-Step/dp/0735622973/ref=pd_bbs_sr_2/026-2613378-9023648?ie=UTF8&s=books&qid=1183984484&sr=8-2 Hope that's of some use!
StewartKnight Posted July 9, 2007 Posted July 9, 2007 I prefer this And the dummies books are useless in my opinion. The SAM books are slightly better, but still far to basic.
bishopsgarthstockton Posted July 10, 2007 Author Posted July 10, 2007 hey guys sorry late responce yeh i think the dummies books are rubbish and aint the money. as im also studying towards the mcse 2003, i figured it would be a good idea to learn VBScript. will windows power shell run on server 2003 and xp?
bishopsgarthstockton Posted July 10, 2007 Author Posted July 10, 2007 looks like it does, just been flicking through MS website
logonui Posted July 11, 2007 Posted July 11, 2007 I prefer AutoIT for automations i found it far easier to learn and comes with its own compiler
altecsole Posted July 11, 2007 Posted July 11, 2007 Personally I wouldn't bother learning VBS now, it's been superceded by PowerShell, and will be the foundation scripting lang, command line, and basis for future MS OS's & server apps, as well as working with current versions. Might as well learn the latest stuff. If possible, I'd learn them both. Powershell is really the way forward but some things are still easier to knock together using vbscript. For example, try creating a shortcut using Powershell or, as I had to do, changing a shortcut path using a script. You can do this in vbscript, but I couldn't find any way to do it in Powershell. In the end I called some vbscript from within Powershell to do the job. The ability to use vbscript within Powershell is fantastic, but you need to learn some vbscript to make full use of it.
NetworkGeezer Posted July 11, 2007 Posted July 11, 2007 If possible, I'd learn them both. Powershell is really the way forward but some things are still easier to knock together using vbscript. For example, try creating a shortcut using Powershell or, as I had to do, changing a shortcut path using a script. You can do this in vbscript, but I couldn't find any way to do it in Powershell. In the end I called some vbscript from within Powershell to do the job. The ability to use vbscript within Powershell is fantastic, but you need to learn some vbscript to make full use of it. The Wscript.Shell object, which is normally used in VBS for manipulating shorcuts, is also availible in PowerShell $WshShell = New-Object -ComObject WScript.Shell $lnk = $WshShell.CreateShortcut("$Home\Desktop\PSHome.lnk") $lnk.TargetPath = $PSHome $lnk.Save() That example is from the PowerShell user guide, showing how to create a shortcut to the PowerShell application folder. The only objects from VBS/WSH that aren't are avaible to PowerShell are Wscript and language specific classes in VBS (e.g. RegXp, Matches, Err, Debug etc.) It's still worth learning VBS as PowerShell is unlikely to take over just yet. PowerShell needs a download on all supported platforms apart from maybe Windows Server 2008 and is not supported on Windows 2000. VBS doesn't suffer from these issues.
altecsole Posted July 12, 2007 Posted July 12, 2007 Yes, thanks. Didn't explain myself very well. That's what I had to do. What I meant was that the syntax used in this case is the same as you'd use with vbscript, so learning vbscript too would be an advantage. Like you say, until PowerShell is included as part of the OS there will always be a place for vbscript. In particular, things like startup scripts and logon scripts. PowerShell seems much better with things like WMI, so you pick the most appropriate one for the job (that's what I intend to do).
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now