script writing examples
Mar 11
Writing css, design, javascript, movie script writing examples, play script writing examples, web, Writing No Comments
![]() |
![]() AVON Representative Business Sales Tools Templates US $9.95
|
![]() The Umbrella Man and Other Stories by Roald Dahl US $.99
|
| 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
![]() |
![]() AVON Representative Business Sales Tools Templates US $9.95
|
![]() The Umbrella Man and Other Stories by Roald Dahl US $.99
|
![]() Patterns of Enterprise Application Architecture by M US $40.89
|
![]() 2 Leaves Red Illuminated Syriac Nestorian Printed Bible US $19.99
|
![]() Life Beyond Earth Timothy Ferris Audiobook Fast S H US $2.99
|
![]() Biology by David Krogh 2008 Paperback US $52.50
|
![]() BLACK GRAY AIRBRUSHED LICENSE PLATE PERSONALIZED NEW US $9.95
|
![]() Pineapple Express Blu ray Disc 2009 UNRATED SPECIAL US $5.00
|
![]() THE GILDED AGE Mark Twain 1874 Rare Early Edition US $9.99
|
![]() PREISNER PEWTER 5 PC TEA AND COFFEE SET US $650.00
|
![]() 10 personalized 25OZ glass beer mugs groomsmen ENGRAVED US $110.00
|
![]() Popular Writing in America by Donald McQuade Robert US $.99
|
![]() Visible Traces Rare Books of China Prints Plates US $9.99
|
![]() 8 Engraved Glass Mugs Shot Glass Set Weddings Groomsmen US $100.50
|
![]() Capote DVD Philip Seymour Hoffman PERFECT US $.99
|
![]() Pineapple Express Blu ray Disc 2009 2 Disc Unrated US $6.00
|
![]() CAPTAIN AMERICA ANNUALS 11 NM 12 NM BANTAM US $.99
|
![]() CAPTAIN AMERICA ANNUALS 9 NM 10 VF RED SKULL US $.99
|
![]() How to Promote Your Website Ezine Easily ON CD US $2.75
|
![]() Adsense CLONE Web Sites PHP SCRIPTS Domain Templates US $1.99
|
![]() Sun Microsystems Java Complete Learning CBT US $59.99
|
![]() SCIENCE FOR ALL VOL I Rbt Brown HB ILLUS c 1880 US $9.99
|
![]() FLOWER DRUM SONG Broadway Musical EASY PIANO Rodgers H US $10.00
|
![]() WHEN I GROW TOO OLD TO DREAM N Eddy ROMBERG Hammerstein US $5.00
|
![]() Portable Shell Programming An Extensive Collection of US $15.85
|
![]() PHP MySQL Programming Guide for IBM i US $69.95
|
![]() NEW Access 2003 All in One Desk Reference for Dummies US $7.19
|
![]() TABLE MANNERS EMILY POST ETIQUETTE TRAINING 2 DVDs J45 US $10.99
|
![]() Intermediate Arabic For Dummies by Keith Massey US $5.73
|
![]() 1 personalized 1L glass beer mug football engraved US $18.99
|
![]() 2 personalized 25OZ glass beer mugs groomsmen engraved US $34.99
|
![]() Writing Short Scripts NEW by William H Phillips US $23.53
|
![]() Writing and Scripts History and Techniques NEW US $31.68
|
![]() FileMaker 8 Functions and Scripts Desk Reference US $9.90
|
![]() How to Get the Part Without Falling Apart Featurin US $9.47 |
![]() Foreign Dialects A Manual for Actors Directors and W US $47.97
|
![]() Four Screenplays Studies in the American Screenplay Sy US $5.41 |
![]() In the Middle Second Edition New Understanding about US $70.60
|
![]() Intermediate Arabic for Dummies by Keith Massey US $3.97
|
![]() Sidney Lumet Autobiography Making Movies Director US $18.99
|
| Powered by phpBay Pro |
RSS

US $9.95






































