Here is one Example of VB Script. Copy below script in notepad, save as outlook.vbs.
Double click outlook.vbs. If the Microsoft outlook is running, this Script will show message: MS Outlook is running.
Or it will show massage: MS Outlook is not running.
strComputer = "."
Set objWMIService = GetObject("winmgmts:\\" & strComputer & "\root\cimv2")
Set colProcesses = objWMIService.ExecQuery _
("Select * from Win32_Process Where Name = 'OUTLOOK.EXE'")
If colProcesses.Count = 0 Then
Wscript.Echo " MS Outlook is not running."
Else
Wscript.Echo " MS Outlook is running."
End If
You might be thinking, “This scripting stuff looks pretty complicated.” Believe it or not, scripting isn’t just for professional computer programmers. There are much more powerful and complicated tools for programmers to use. Don’t get us wrong, a script can be powerful and complicated, but you can also write some fairly simple scripts that can be very helpful. So don’t let the thought of this stuff being “code” scare you off. There are a lot of things you can do pretty easily with no programming experience at all.
One of the advantages of scripting over other types of programming is that for scripting, everything you need is built into the operating system. It needs some acronyms such as VBScript, WSH, and WMI. All of those things are part of scripting, and they’re all built into Windows. You also don’t need fancy, expensive software to write a script. As you saw already, all you really need is Notepad, which, once again, is built-in.
In addition, scripting is specifically designed to help you administer your operating system. Even the most talented programmer would never attempt to create a full-blown software application, such as Word or Excel, using scripts. Scripts allow you to automate system administration tasks.
There are other scripting languages besides VBScript, and there are tools you can use to write scripts other than Notepad. But you can investigate all that on your own after you get a little scripting experience. Most of the scripts and examples on the Script Center use VBScript.
IMPORTANT: One last thing about system administration scripting, and it’s a really important thing to know. For most scripts to run, at least scripts that do anything very interesting, you must have local administrator rights to the machine the script is running against. Many of the scripts available on the Script Center will fail if you’re not running them as a local administrator.
Wednesday 20 July 2011
VB Scripting - Part 1
Scripting is just a way to automate getting information to and from your computer (and other computers).
This is the very first thing you need to know to start using scripts to manage your Microsoft Windows systems. On the Script Center (and possibly elsewhere on the Internet, but we can’t vouch for anyone else), you’ll find a lot of pre-made, ready-to-go scripts. A script will look something like this:
Wscript.echo "My very first script."
Yes, that one line is a script. It’s a very simple script, most are longer than this, but it’s still a script. Now you might be wondering what to do with that one line. It’s very simple:
• Open Notepad.
• Copy the script from your browser and paste it into Notepad.
• Save the script with a .vbs extension, such as test.vbs.
Now double click the file test.vbs
If you did this with the script above, you’ll have output that looks like this: My very first script.
Our first script did this: we gave a sentence to the computer and got the same sentence back from the computer. This may not seem like an especially useful feature, but this was just a first step, and one step doesn’t even get you all the way across the room, let alone out the door.
Mr. Amol Vaidya (Technical Director, WIS) always says “If you need to do one task more than one time, just write a script for it”.
There are a number of scenarios where scripts start to get really useful. Here are just a few:
•You have to perform a series of system administration tasks on a regular basis
•You have to perform a series of system administration tasks on several computers
•You want to consolidate and organize the output you get from the computer
•You want to run tasks when you’re not there to interact with the GUI
If you think about some of the work you have to do as a system administrator, you might already be imagining tasks you want to script.
This is the very first thing you need to know to start using scripts to manage your Microsoft Windows systems. On the Script Center (and possibly elsewhere on the Internet, but we can’t vouch for anyone else), you’ll find a lot of pre-made, ready-to-go scripts. A script will look something like this:
Wscript.echo "My very first script."
Yes, that one line is a script. It’s a very simple script, most are longer than this, but it’s still a script. Now you might be wondering what to do with that one line. It’s very simple:
• Open Notepad.
• Copy the script from your browser and paste it into Notepad.
• Save the script with a .vbs extension, such as test.vbs.
Now double click the file test.vbs
If you did this with the script above, you’ll have output that looks like this: My very first script.
Our first script did this: we gave a sentence to the computer and got the same sentence back from the computer. This may not seem like an especially useful feature, but this was just a first step, and one step doesn’t even get you all the way across the room, let alone out the door.
Mr. Amol Vaidya (Technical Director, WIS) always says “If you need to do one task more than one time, just write a script for it”.
There are a number of scenarios where scripts start to get really useful. Here are just a few:
•You have to perform a series of system administration tasks on a regular basis
•You have to perform a series of system administration tasks on several computers
•You want to consolidate and organize the output you get from the computer
•You want to run tasks when you’re not there to interact with the GUI
If you think about some of the work you have to do as a system administrator, you might already be imagining tasks you want to script.
Monday 4 July 2011
Create Different Shapes using CSS
Cascading Style Sheets (CSS) is a simple mechanism for adding style (e.g., fonts, colors, spacing) to Web documents. Styles define how to display HTML elements. Style sheets are a very powerful tool for the Web site developer. They give you the chance to be completely consistent with the look and feel of your pages, while giving you much more control over the layout and design than straight HTML.
I am going to show you how to create different shapes in CSS
Simple shapes-
Square:
.square {
width: 100px;
height: 100px;
background: red; }
Circle
.circle {
width: 100px;
height: 100px;
background: red;
-moz-border-radius: 50px;
-webkit-border-radius: 50px;
border-radius: 50px; }
Triangle:
.triangle-up {
width: 0;
height: 0;
border-left: 50px solid transparent;
border-right: 50px solid transparent;
border-bottom: 100px solid red; }
Complex Shapes-
Star
.star-six {
width: 0;
height: 0;
border-left: 50px solid transparent;
border-right: 50px solid transparent;
border-bottom: 100px solid red;
position: relative; }
.star-six:after {
width: 0;
height: 0;
border-left: 50px solid transparent;
border-right: 50px solid transparent;
border-top: 100px solid red;
position: absolute;
content: "";
top: 30px;
left: -50px; }
Finally The Smiley Face Using CSS :
Create following divs on Page
<div class="smileyface">
<p class="eyes lefteye"></p>
<p class="eyes righteye"></p>
<div class="smile">
<div class="corner"></div>
<div class="corner right"></div>
</div>
</div>
Create following styles in Style Tag
div.smileyface {
width: 300px;
height: 300px;
position: relative;
border-radius: 150px;
-webkit-border-radius: 150px;
-moz-border-radius: 150px;
display: block;
background: #ffe632;
background: -webkit-gradient(linear, left top, left bottom, from(#fffe8d), to(#f6d23e));
background: -moz-linear-gradient(top, #fffe8d, #f6d23e);
box-shadow: inset 0px -14px 14px rgba(0, 0, 0, .3), 0px 2px 20px rgba(0, 0, 0, .6);
-webkit-box-shadow: inset 0px -14px 14px rgba(0, 0, 0, .3), 0px 2px 20px rgba(0, 0, 0, .6);
-moz-box-shadow: inset 0px -14px 14px rgba(0, 0, 0, .3), 0px 2px 20px rgba(0, 0, 0, .6);
behavior:url(CSS/Corner.htc);/*Gives Corner shapes in IE */
}
p.eyes {
width: 50px;
height: 80px;
background: #222;
border-radius: 100px/160px;
-webkit-border-radius: 100px 160px;
-moz-border-radius: 100px/160px;
position: absolute;
top: 40px;
box-shadow: 0 2px 0 rgba(255,255,255, 0.8);
-webkit-box-shadow: 0 2px 0 rgba(255,255,255, 0.8);
-moz-box-shadow: 0 2px 0 rgba(255,255,255, 0.8);
behavior:url(CSS/Corner.htc);/*Gives Corner shapes in IE */ }
p.eyes.lefteye {
left: 75px;
}
p.eyes.righteye {
right: 75px;
behavior:url(CSS/Corner.htc);/*Gives Corner shapes in IE */ }
div.smile {
width: 200px;
height: 70px;
border: 10px solid #222;
border-top: 0;
background: rgba(0,0,0,0);
-moz-border-radius: 0 0 120px 120px / 0 0 90px 90px;
-webkit-border-radius: 0 0 120px 120px 0 0 90px 90px;
border-radius: 0 0 120px 120px / 0 0 90px 90px;
position: absolute;
bottom: 50px;
left: 38px;
box-shadow: 0 2px 0 rgba(255,255,255, 0.8);
-webkit-box-shadow: 0 2px 0 rgba(255,255,255, 0.8);
-moz-box-shadow: 0 2px 0 rgba(255,255,255, 0.8);
behavior:url(CSS/Corner.htc);/*Gives Corner shapes in IE */ }
div.corner {
width: 10px;
height: 30px;
background: #222;
border-radius: 100px/160px;
-webkit-border-radius: 100px 160px;
-moz-border-radius: 100px/160px;
position: absolute;
top: -12px;
-webkit-transform: rotate(65deg);
-moz-transform: rotate(65deg);
left: -12px;
behavior:url(CSS/Corner.htc);/*Gives Corner shapes in IE */ }
div.corner.right {
left: 202px;
-webkit-transform: rotate(-65deg);
-moz-transform: rotate(-65deg);
behavior:url(CSS/Corner.htc);/*Gives Corner shapes in IE */
}
I am going to show you how to create different shapes in CSS
Simple shapes-
Square:
.square {
width: 100px;
height: 100px;
background: red; }
Circle
.circle {
width: 100px;
height: 100px;
background: red;
-moz-border-radius: 50px;
-webkit-border-radius: 50px;
border-radius: 50px; }
Triangle:
.triangle-up {
width: 0;
height: 0;
border-left: 50px solid transparent;
border-right: 50px solid transparent;
border-bottom: 100px solid red; }
Complex Shapes-
Star
.star-six {
width: 0;
height: 0;
border-left: 50px solid transparent;
border-right: 50px solid transparent;
border-bottom: 100px solid red;
position: relative; }
.star-six:after {
width: 0;
height: 0;
border-left: 50px solid transparent;
border-right: 50px solid transparent;
border-top: 100px solid red;
position: absolute;
content: "";
top: 30px;
left: -50px; }
Finally The Smiley Face Using CSS :
Create following divs on Page
<div class="smileyface">
<p class="eyes lefteye"></p>
<p class="eyes righteye"></p>
<div class="smile">
<div class="corner"></div>
<div class="corner right"></div>
</div>
</div>
Create following styles in Style Tag
div.smileyface {
width: 300px;
height: 300px;
position: relative;
border-radius: 150px;
-webkit-border-radius: 150px;
-moz-border-radius: 150px;
display: block;
background: #ffe632;
background: -webkit-gradient(linear, left top, left bottom, from(#fffe8d), to(#f6d23e));
background: -moz-linear-gradient(top, #fffe8d, #f6d23e);
box-shadow: inset 0px -14px 14px rgba(0, 0, 0, .3), 0px 2px 20px rgba(0, 0, 0, .6);
-webkit-box-shadow: inset 0px -14px 14px rgba(0, 0, 0, .3), 0px 2px 20px rgba(0, 0, 0, .6);
-moz-box-shadow: inset 0px -14px 14px rgba(0, 0, 0, .3), 0px 2px 20px rgba(0, 0, 0, .6);
behavior:url(CSS/Corner.htc);/*Gives Corner shapes in IE */
}
p.eyes {
width: 50px;
height: 80px;
background: #222;
border-radius: 100px/160px;
-webkit-border-radius: 100px 160px;
-moz-border-radius: 100px/160px;
position: absolute;
top: 40px;
box-shadow: 0 2px 0 rgba(255,255,255, 0.8);
-webkit-box-shadow: 0 2px 0 rgba(255,255,255, 0.8);
-moz-box-shadow: 0 2px 0 rgba(255,255,255, 0.8);
behavior:url(CSS/Corner.htc);/*Gives Corner shapes in IE */ }
p.eyes.lefteye {
left: 75px;
}
p.eyes.righteye {
right: 75px;
behavior:url(CSS/Corner.htc);/*Gives Corner shapes in IE */ }
div.smile {
width: 200px;
height: 70px;
border: 10px solid #222;
border-top: 0;
background: rgba(0,0,0,0);
-moz-border-radius: 0 0 120px 120px / 0 0 90px 90px;
-webkit-border-radius: 0 0 120px 120px 0 0 90px 90px;
border-radius: 0 0 120px 120px / 0 0 90px 90px;
position: absolute;
bottom: 50px;
left: 38px;
box-shadow: 0 2px 0 rgba(255,255,255, 0.8);
-webkit-box-shadow: 0 2px 0 rgba(255,255,255, 0.8);
-moz-box-shadow: 0 2px 0 rgba(255,255,255, 0.8);
behavior:url(CSS/Corner.htc);/*Gives Corner shapes in IE */ }
div.corner {
width: 10px;
height: 30px;
background: #222;
border-radius: 100px/160px;
-webkit-border-radius: 100px 160px;
-moz-border-radius: 100px/160px;
position: absolute;
top: -12px;
-webkit-transform: rotate(65deg);
-moz-transform: rotate(65deg);
left: -12px;
behavior:url(CSS/Corner.htc);/*Gives Corner shapes in IE */ }
div.corner.right {
left: 202px;
-webkit-transform: rotate(-65deg);
-moz-transform: rotate(-65deg);
behavior:url(CSS/Corner.htc);/*Gives Corner shapes in IE */
}
Google +
Google has just unveiled Google+, its ambitious answer to Facebook.
It seems Google is eager to make a big impact in the social media sector as in the mail, search, photo and document storage domains.
The Google+ project is the company’s social initiative that brings friend streams, group video chat and group texting to Google’s millions of users.
On Google Plus there are only four silos (Home, Photos, Profile, Circles) to click on. Here one cannot find games nor Farmville! It is simple and in Google’s fashion with lot of white space. The ‘Stream' is the equivalent of FB's scroll newsfeed, and there are similar options — to share, edit, host photos and videos, and delete them.
Unlike Facebook, Google Plus allow people to share things with you even if you're not following them. Thus, you'll want to check your Incoming feed now and then to see whether you're missing out on anything interesting from someone you don't follow.
Use the Your Circles option while sharing. Google Plus's Circles system is great for letting you use your Plus account to set barriers between the various groups of people you want to share things with. If most of what you share on Google Plus isn't especially privacy-sensitive, however, use the Your Circles sharing option to automatically share items with all of your circles and avoid the trouble of clicking each individual circle.
Google+ is a bold and dramatic attempt at social front. There’s a reason why Google calls this a “project” rather than a “product” — they don’t want people to think of this as the final product, but as a constantly-evolving entity.
At the moment, Google+ cannot compete with the king of social, but Google doesn’t seem to be in a hurry to take on Mark Zuckerberg’s giant quite yet.
It seems Google is eager to make a big impact in the social media sector as in the mail, search, photo and document storage domains.
The Google+ project is the company’s social initiative that brings friend streams, group video chat and group texting to Google’s millions of users.
On Google Plus there are only four silos (Home, Photos, Profile, Circles) to click on. Here one cannot find games nor Farmville! It is simple and in Google’s fashion with lot of white space. The ‘Stream' is the equivalent of FB's scroll newsfeed, and there are similar options — to share, edit, host photos and videos, and delete them.
Unlike Facebook, Google Plus allow people to share things with you even if you're not following them. Thus, you'll want to check your Incoming feed now and then to see whether you're missing out on anything interesting from someone you don't follow.
Use the Your Circles option while sharing. Google Plus's Circles system is great for letting you use your Plus account to set barriers between the various groups of people you want to share things with. If most of what you share on Google Plus isn't especially privacy-sensitive, however, use the Your Circles sharing option to automatically share items with all of your circles and avoid the trouble of clicking each individual circle.
Google+ is a bold and dramatic attempt at social front. There’s a reason why Google calls this a “project” rather than a “product” — they don’t want people to think of this as the final product, but as a constantly-evolving entity.
At the moment, Google+ cannot compete with the king of social, but Google doesn’t seem to be in a hurry to take on Mark Zuckerberg’s giant quite yet.
Subscribe to:
Posts (Atom)