script writing examples
Mar 11
Writing css, design, javascript, movie script writing examples, play script writing examples, web, Writing No Comments
![]() |
![]() Established Gift Shop Website Business for sale online US $.01
|
![]() Established Video Game Website Business online shop US $.01
|
| Powered by phpBay Pro |
Basic Windows Scripting
Microsoft has created a very powerful scripting language that can control almost every aspect of the Windows operating system. As I'll be discussing here are just the basics that apply primarily to Windows XP. Windows Script has been around since Windows 98, but as operating systems have advanced scripting language is well.
All the tools we need to create Windows scripts are included in windows and the notebook is simple. You can get other publishers to use as Script Editor, SciTE and Scintilla, and many more. But all you need is Notepad and you're ready to go. When you create a script file will create the desired name and can be given the extension. VBS (Visual Basic Script).
Lets write the first script, the famous Hello World script, when you open the notebook and simply write:
wscript.echo "Hello World"
Now simply double click the file you created and you will see a popup box that displays the text "Hello World" give it a try. This script can also be executed by a command prompt, type "cscript hello.vbs" in the command prompt.
All good programmers comment their programs so that years from now can look back on a program he wrote and say what you are doing based on the comments. A comment is simply the text the program that is only seen by the programmer and not by the person running the program. You can write whatever you want in a comment and not effect the program in any way. Professional Comment programmers in all aspects of your program so that those reading the code can understand what you are doing. To add a comment to a file, simply VBS type REM or 'at the beginning of a line and everything in that line is a comment and have no effect on the program. Lets look at our program Hello.vbs and lets add a couple of comments in the program to know what is happening.
"Hello.vbs
"This is just the typical Hello World program
wscript.echo "Hello World"
If something bad happens to windows will give an error rate that tells you've done something wrong and even give you the line that the error is on. We will ruin our program and see what kind of error we receive.
"Hello.vbs
"This is just the typical Hello World program
wscript.echo "Hello World"
wscript.echo "I messed up this line
Now let's run the program and see what kind of error we have. The first line runs fine, but received an error in the second Online:
Script: C: Users mike Desktop hello.vbs
Line: 5
Char: 1
Errno: Object does not support this property or METHOD: 'Wscript.echo'
Code: 800A01B6
Source: Microsoft VBScript runtime error
So as you can see from this error that we have a problem in line 5 1 character of our code. The error object does not support this property or method: 'wscript.echo' usually means you have a spelling error somewhere. The code is not really that important to know exactly where the problem is and what the "error" actually says.
As with any programming language VBScript uses variables to store values and strings. To assign a value to a variable simply use the variable name you want, then the sign =. One would examble 'Mike = 24' Now the microphone variable has a value of 24, now let's add this to our program World Hello and show that the microphone variable has a value of 24.
"Hello.vbs
'This is the typical Hello World program
WScript.Echo "Hello World"
mike = 24
jake = 30
this = jake - Mike
wscript.echo "Mike is," mike
wscript.echo "Jake" jake
wscript.echo "The difference between his age," this
As you can see here we assigned the value 24 to the microphone variable and assigns the value of the variable 30 to jake. We were able to carry out and mathmatical operation in the two values to obtain the difference between them. Then by the wscript.echo command could see the variables. We will continue with the variables and can store a string that is stored in text form and we will take input from our users.
'Hello.vbs
"This is the typical Hello World program
name = InputBox ("How your name? ")
age = InputBox ("How old are you?")
wscript.echo "Hello", name
wscript.echo age "is a good age"
Do you get the input box to appear will use the InputBox command and use the = sign to assign what the user types in a variable and then we can print the results on the screen. Now let's go a little further and allows the program to make a decision what to do based on what the user. For this program to make a decision that will be using the IF ... ELSE IF ... ANOTHER THING ... statements.
"Hello.vbs
"This is the typical Hello World program
name = InputBox ("What's your name?")
age = InputBox ("How many old are you? ")
wscript.echo "Hello", name
If age <18 Then
wscript.echo "You're illegal!"
ElseIf age> 17 and 24 <Age Then
wscript.echo "You are a young"
ElseIf age = 24 Then
wscript.echo "You are at the best age! (same as at my age)"
More
wscript.echo "WoW you're old! "
End If
With the above script we have been able to receive input from the user and then take a decision on what to do based on what the user typed in. I'm going to go through each line and describe exactly what you are doing so that you can understand the program.
name = InputBox ("What's your name?")
age = InputBox ("How old are you?")
Display and input box asking the user "What is your name" then stores the value in the name of the variable. Below is another input box asking the user "How old are you?" and stores the value on the form to the age. For this explanation we will say that the user typed in 24 for age.
wscript.echo "Hello", name
This line simply shows that the variable name is the user typed in the box the first inning.
If age <18 then
wscript.echo "You're illegal! "
This line is run as read, if the variable age is less than 18 then print on the screen "You're illegal!". As mentioned above, the age variable will be 24 at that age no less than 18 so the line directly below now run.
ElseIf age> 17 and 24 <Age Then
wscript.echo "You're young"
The previous statments is by ElseIf statement will be considered only if the claim above is false. Now we are checking if the variable age is between 17 and 24, and if we will print "You're young." But as the variable age is 24, then is between 17 and 24 so this statement will not run and will move to the next.
Age = 24 Then ElseIf
wscript.echo "You is in the best age! (Same as at my age) "
This statement is the same as above, except that we are seeing if the variable age equals 24 and if to execute the line directly below it. In our example, since we did the rate in 24 years so the variable is equal to 24 direct line will be executed under windows and pop-up that says "You are at the best age! (same as at my age)" and all the IF statement is completed. Now let us continue with this example and check the last line.
More
wscript.echo "WoW you are old!"
End If
The Else statement is executed only if none of the above criteria are met and in our case because the age variable is equal to 24, the Else statement is not executed. Then, add the End If statement at the end to tell the program throughout the IF statement is here.
We've covered VBScript lot of ground here so please review everything we've talked about and play with the scripts. Experiment and see what you can do with the script and think about how You can mix multiple input variables and IF statements to make boxes and a very useful program that can make your life easier.
I said at first I was going to discuss a script I created to modernize a previous piece of software to save money on the upgrade. What I will discuss here was not referred to in this article, but will give you an idea of the kinds of things you can do with scripts.
I was asked to perform a task in the working to migrate all our systems of higher pager alert our latest mobile phones using text messages. This was not a big problem with most of our software because of the ability to send an email to cell phones as a text message. But we had two very important pieces of software it was around $ 10,000 apiece to upgrade to a version that would be able to send emails and the improvement was not an option during the time we've had to implement our new cell phones.
Both programs were able to print to a printer, an alert happened. I have to install programs to print to a file and put it in a specific directory whenever an alert step. The script he wrote in a loop every 10 seconds and look for a new particular file, that directory. When the script found a new file in the e-mail would then be the contents of the file in the appropriate cell phone and then delete the file and look for another new file.
Please keep watching for new items for more details about Windows Scripting. If you have questions or want more details about my script sending a personalized email please contact me. Thanks for reading
About the Author
Mike Walton has been in the technology field for over 8 years and has 6+ years in hospitality technolgy. Mike has experience with Microsoft Windows Server 2000, 2003, Windows 98, XP, and Vista, Networking, Cisco Equipment, PCI DSS, and many more. Mike Walton is also the founder of MikeNet PC Free Articles and Videos.
http://www.mikenetpc.com
Avid Xpress Pro - Making the Move to Media Composer - Media Composer Editing
![]() |
![]() Established Gift Shop Website Business for sale online US $.01
|
![]() Established Video Game Website Business online shop US $.01
|
![]() Jewelry Website Business established online web shop st US $.01
|
![]() Online Mobile Cell Phone supplies Website Business Shop US $.01
|
![]() Online Pet Shop Website business for sale 100 complet US $.01
|
![]() Online Marine Website Business Shop sea ocean boat US $.01
|
![]() Established Online DVD movie website business store sho US $.01
|
![]() Established Online Computer Website Business Store shop US $.01
|
![]() Established Online General Website Business Shop store US $.01
|
![]() 20s BOOK LETTERING ALPHABETS BRUSH SIGN WORK GOTHIC ABC US $32.33
|
![]() CAPTAIN AMERICA ANNUALS 11 NM 12 NM BANTAM US $.99
|
![]() CAPTAIN AMERICA ANNUALS 9 NM 10 VF RED SKULL US $.99
|
![]() Unix System 5 by Mark G Sobell 1994 Paperback Su US $4.99
|
![]() AVON Representative Business Sales Tools Templates US $9.95
|
![]() 4 personalized glass beer mugs weddings sports gifts US $38.65
|
![]() SCREENWRITING TRICKS OF THE TRADE by WILLIAM FROUG US $1.99
|
![]() The Killing of John Lennon DVDJonas Ball NEW US $11.99
|
![]() 2 Leaves Red Illuminated Syriac Nestorian Printed Bible US $19.99
|
![]() How to Promote Your Website Ezine Easily ON CD US $1.75
|
![]() Perl Cookbook by Nathan Torkington Tom Christiansen US $3.99
|
![]() Your WebSite ADSENSE Niche HTML PHP scripts packages pc US $1.00
|
![]() Popular Writing in America by Donald McQuade Robert US $27.95
|
![]() The Screenwriters Manual by Peter A Zorn Ronald M US $.10
|
![]() The Umbrella Man and Other Stories by Roald Dahl US $.99
|
![]() UNIX Unbounded by Amir Afzal 2002 Paperback US $40.00
|
![]() NEW Story McKee Robert McKee Robert NRT US $18.30
|
![]() How to Write Erotica and The Last Starfighter US $.99
|
![]() Air Words by John Hewitt 2001 Paperback US $45.00
|
![]() HISTORIC 20th CENTURY COMMEMORATIVE PAIRPOINT LAMP US $2,995.00
|
![]() BOLDEST NAZI BILL WEVE EVER SEEN REPRINT OF RARE ORIG US $7.99
|
![]() BLACK GRAY AIRBRUSHED LICENSE PLATE PERSONALIZED NEW US $12.95
|
![]() Biology by David Krogh 2008 Paperback w access code US $74.99
|
![]() Art and Practice of Lettering Calligraphy CD US $6.20
|
![]() Sun Microsystems Java Complete Learning CBT US $59.99
|
![]() Write Brothers Screenplay Suite BRAND NEW FREE SHIP US $249.95
|
![]() The Medical Billing Home Business Bible US $20.00
|
![]() Hypnosis for Smoking Cessation book free bonus CD US $45.00
|
![]() 8 Engraved Glass Mugs Shot Glass Set Weddings Groomsmen US $100.50
|
![]() Biology A Guide to the Natural World 4th Edition Da US $74.34
|
![]() Adsense CLONE Web Sites PHP SCRIPTS Domain Templates US $1.00
|
| Powered by phpBay Pro |
RSS

US $.01





















































































![Final Draft 7 Professional Scriptwriting [OLD VERSION]](http://www.writeelement.com/images/i/41wz2nondIL._SL75_.jpg)


