Windows Server 2000/2003 Thread, Learning Scripting in Technical; Hi there
i'm looking at learning a few new things and wanted to know how to create scripts. Things like ...
23rd February 2010, 04:32 PM #1
- Rep Power
i'm looking at learning a few new things and wanted to know how to create scripts. Things like startup/logon scripts for various things.
Is there anywhere at all that tells you how to start scripting or any book thats a good beginners guide?
My current boss just says he cobbles them together from other peoples scripts off the internet but i'd like to understand how to write them an what things mean.
IDG Tech News
23rd February 2010, 04:39 PM #2
I am all self taught [ which means I have really bad habits ] - but I would start at the very basic level of batch stuff, then work your way to say VBS, WSH, Powershell, Kix - there are loads of others and you will find your favorite. My favorite is AutoIT and I tend to do most things in that although I must get down and start doing some powerhshell at some point - but at the moment I can't be arsed....
Originally Posted by darkmanx
Is a good starting point.
Books which I use and have learnt a great deal from:
Windows Administration at the command line
Windows Powershell programming
Windows Admin Scripting Little Black Book, Second Edition
Last edited by mattx; 23rd February 2010 at 04:43 PM.
23rd February 2010, 04:39 PM #3
- Rep Power
As a reference I've found this site ( WiseSoft - Resources for IT Professionals ) to be helpful.
They also have a Script Builder (which is what your trying to avoid but is useful nonetheless)
23rd February 2010, 04:43 PM #4
23rd February 2010, 04:48 PM #5
is this not what edugeek is for? have a play if you think it should work and it doesnt then ask one of the very kind people on here. I have taught myself alot of it from other edugeekers helping me when i am trying to put them together. i have just started moving onto PHP which is even more complicated!
23rd February 2010, 05:03 PM #6
For VBS I use this: VbsEdit - Award-winning VBScript Editor - VBS editor - VBScript debugger - VBS debugger or this: .:: NOTEPAD++ ::. which also supports many other scripting languages.
VbsEdit comes with a script repository which is appears to be mostly taken from Microsoft's Script Center
You might find this VBScript Tutorial useful though it's more geared towards the web.
Microsoft have their own guide and reference: VBScript
Three tips for scripting/programming:
1. Keep your code clean and easily readable - I use indents a lot so I can easily see the blocks/loops/conditionals etc...
2. Use comments. Give each function/subroutine a quick description of what it does and comment complex statements. Don't be afraid to go overboard. You can always trim or remove them once your happy with your script.
3. Debugging - with complex VBS I usually use message boxes to display what's being held in variables so I can check the program is doing what it's supposed to. I comment them with "debug" so I can easily find and remove them afterwards.
23rd February 2010, 05:17 PM #7
ref debugging when dealing with the file system object ( FSO ) I used a text file to output what files / folders it found and also output which ones it should of deleted as text data so it didnt actually delete the files so I could get the script to work as I wanted (more or less ) before trying it
Originally Posted by Gerry
Last edited by mac_shinobi; 23rd February 2010 at 05:20 PM.
23rd February 2010, 05:22 PM #8
At the risk of starting a religious war, the best starting point is the Microsoft scripting site - Script Center
They ought to know how to use their scripting technologies :-)
Thanks to srochford from:
mac_shinobi (23rd February 2010)
23rd February 2010, 05:23 PM #9
lol @ part highlighted in bold
Originally Posted by srochford
I put the computer performance one because I use that a lot and it has examples which are more or less walked through numerically etc and it has a lot of examples with ref to wmi, fso, etc
Last edited by mac_shinobi; 23rd February 2010 at 05:28 PM.
23rd February 2010, 05:26 PM #10
23rd February 2010, 05:34 PM #11
The best thing would be to start with a platform independent language such as Python, because what you learn there will apply to Windows, OSX, Unix, Linux which greatly broadens your horizons.
At the risk of starting a religious war,
That's what Open Source code is all about - someone writes some code, and we are all free to use it and adapt it.
My current boss just says he cobbles them together from other peoples scripts off the internet
23rd February 2010, 05:37 PM #12
No, start with Batch, because it's easy.
Originally Posted by CyberNerd
23rd February 2010, 08:07 PM #13
Quite right - [ I stated this in my first posting on this ] - it will give you a good understanding to start with, just DON'T use GOTO - learn how to use loops etc otherwise you will end up with spaghetti code - and trust me you don't want to go there....
Originally Posted by K.C.Leblanc
23rd February 2010, 08:24 PM #14
That sounds like a perfectly good way to start - pick some real task you need to actually do ("learning" tasks really don't work outside a formal classroom environment for programming) and do it, even if you cobble together lines pasted from the Internet someplace. Then figure out how your script works, line by line - follow your program through as if you're the computer executing the code.
Originally Posted by darkmanx
24th February 2010, 10:40 AM #15
- Rep Power
brilliant, thanks everyone for the advice some good information there and some great links to work through. Now all I need is some time.....lol
By speckled in forum Scripts
Last Post: 22nd November 2009, 09:09 AM
By mac_shinobi in forum Mac
Last Post: 22nd August 2008, 10:30 AM
By stu in forum How do you do....it?
Last Post: 26th June 2008, 07:47 PM
By dave.81 in forum How do you do....it?
Last Post: 23rd April 2008, 01:50 PM
By FN-GM in forum Scripts
Last Post: 10th August 2007, 11:31 PM
Users Browsing this Thread
There are currently 1 users browsing this thread. (0 members and 1 guests)