February 13, 2009

List all Running Applications through windows script

0 comments

Hi All,

The following is a simple script which will list all the applications inside ur taskmanager applications tab.

Set objWord = CreateObject("Word.Application")
Set colTasks = objWord.Tasks

For Each objTask in colTasks
    If objTask.Visible Then
        Wscript.Echo objTask.Name
    End If
Next

objWord.Quit

Must and should read link:

Infact i actually copied the above code from this link only. This was really very helpful and it explained me a lot. I'd simply like to say: "All the processes which are not running in hidden mode are listed in the applications tab.If a process doesn't have a visible window then it will not be present in the applications tab."

I really insist all of u to go through the above link for a better understanding of things.
Hpy Scripting.........

February 09, 2009

Open Yahoo Mail through Windows Script

0 comments

Hi People,

I'm a Newbie to scripting world. I thought of writing a windows script which will take my credentials and automatically logs me into yahoo. With lots of googling i  m able to write the following code:

set objIE = CreateObject("InternetExplorer.Application")
objIE.Navigate "www.mail.yahoo.com"
objIe.Visible = true

'wait untill page gets loaded
While objIE.busy
WScript.Sleep 1000
Wend

objIE.document.getElementByID("username").value = "my_username"
objIE.document.getElementByID("passwd").value = "my_password"
 objIE.document.getElementsByName(".save")(0).click()

That's it. Copy and paste the above code. Yeah pls fill corresponding username and password fields. This code needs to be worked in the following sections:

1)Inside the if condition i m finding the username textbox through DOM selection and then filling in the appropriate fields. But this may affect if the textbox name changes.

The following are some of the links where u can find some more useful information: