Create an Internet shortcut

To create a shortcut to an url you can do as follows

set oUrlLink = WshShell.CreateShortcut(strDesktop & "\Microsoft Web Site.url")
oUrlLink.TargetPath = "http://www.yahoo.com"
oUrlLink.Save

Create a Desktop shortcut using WSH

If you want to create a shortcut programatically use the code below. Found somewhere on net

'Create a Desktop ShortCut
set WshShell = WScript.CreateObject("WScript.Shell")
strDesktop = WshShell.SpecialFolders("Desktop")
set oShellLink = WshShell.CreateShortcut(strDesktop & "\Shortcut To Notepad.lnk")
oShellLink.TargetPath = "Notepad.exe" 'WScript.ScriptFullName
oShellLink.WindowStyle = 1
oShellLink.Hotkey = "CTRL+SHIFT+N"
oShellLink.IconLocation = "notepad.exe, 0"
oShellLink.Description = "Shortcut To Notepad."
oShellLink.WorkingDirectory = strDesktop
oShellLink.Save

Get the name of the host/ computer


Set WshNetwork = WScript.CreateObject("WScript.Network")
WScript.Echo "Domain = " & WshNetwork.UserDomain
WScript.Echo "Computer Name = " & WshNetwork.ComputerName
WScript.Echo "User Name = " & WshNetwork.UserName

Read a Text File and print line by line


Option Explicit
Dim gpsFile
Dim gpsFileLines
Dim eGpsLine

Dim oFSO : Set oFSO = CreateObject("Scripting.FileSystemObject")
Dim oWS : Set oWS = CreateObject("WScript.Shell")
gpsFile = "c:\yourtextfile.txt"

With oFSO.GetFile(gpsFile)
'Get all Lines
gpsFileLines = Split(.OpenAsTextStream(1, 0).Read(.Size), vbcrlf)
End With

For Each eGpsLine in gpsFileLines
'Print all lines on by one
Wscript.Echo eGpsLine & vbcrlf
Next
Wscript.Quit

Get Processor and OS info

We can get the Processor and OS info like this using the Environment method

Set WshShell = WScript.CreateObject(“WScript.Shell”)
Set WshSysEnv = WshShell.Environment(“SYSTEM”)
WScript.Echo “NUMBER OF PROCESSORS : ” & WshSysEnv(“NUMBER_OF_PROCESSORS”)
WScript.Echo “PROCESSOR ARCHITECTURE : ” & WshSysEnv(“PROCESSOR_ARCHITECTURE”)
WScript.Echo “PROCESSOR IDENTIFIER : ” & WshSysEnv(“PROCESSOR_IDENTIFIER”)
WScript.Echo “OS : ” & WshSysEnv(“OS”)

Get Windows Environment Info

To get the Environment info like Compsec, PAth, pathext windows folder and temporary folder location we can do like this


Set WshShell = WScript.CreateObject("WScript.Shell")
Set WshSysEnv = WshShell.Environment("SYSTEM")
WScript.Echo "COMSPEC (Executable file for the command prompt ) : " &_
 WshSysEnv("COMSPEC")

WScript.Echo "PATH : " & WshSysEnv("PATH")
WScript.Echo "PATHEXT : " & WshSysEnv("PATHEXT")

WScript.Echo "WINDIR : " & WshSysEnv("WINDIR")
WScript.Echo "TEMP : " & WshSysEnv("TEMP")

Financial/Tax Planning with good Retuns

Recently I were discussing with my financial/Insurance advisor regarding this Year’s tax planning. I asked him for a plan that it would help me in
1. tax savings
2. and also it should be an investment which should return more returns at me age of 53.
3. And if anything happens to me my Dependants (wife and kids), won;t be affected and they have to be taken care of with sufficient money for their future.

I’ve opted for 50 Lacs coverage.

There are two plans he suggested.

One Plan is from Birla sun life.
For 50 Lacs
* you have to invest 5000Rs per month else yearly 60000
* you have the option that you can pay 2000 one month if you have less money and if you have more you can pay more. the thing is you should have paid 60000 at the end of the year
* it covers normal death benifits, accidental and even covers major diseases (11 diseases are listed)
* you can get the tax benifits under 80C
* The min lock in period is 4 Yrs. The total investment yrs you have do is 10 yrs. so at the end of 10 yrs you have paid Rs 6Lacs
* Since this is Market linked Policy, With a 10 % projected growth, you would get 23 Lacs(approx).

Another from LIC (Jeevan Tarang)
* you have to pay Rs800+ (age 33) Per Lac for a month.
* at the end of 10 yrs you would get sum assured and the bonus, loyalty addition
* then every year you get Rs 5,500 until your age of 100.
* after our life, our nominee will get another sum assured (say 1 Lac)
* you can get the tax benifits under 80C

after going thru the Jeevan Tarang i decided Like this

In this plan what I would like to suggest is
take a policy for 1 Lac per Month till the next coming 12 Months. so the next April 2008 you would have took 12 policies (apr 2007 -08)
first year (apr 07- apr 08) you will be paying
Rs 800, (1 Policy)
Rs 1600 (for 2 policies)
Rs 2400 (3)

from the next year you have to pay for 12 policies / month up to 10 Years.
After Apr 2017 (10 yrs)
you will get 10 Lacs with bonus + addition
and 5,500 per Month until your age of 100
your nominee will get another sum assured Rs. 10 Lac.
Sounds really good.??? this is better than any other pension policy which won’t yield this much returns

Let me know your thoughts