Few Additonal Scripts

'Shell Script- Open Notepad-write data and save file
Dim x
Set x=CreateObject("WScript.Shell")
x.Run "notepad.exe"
wait(5)
x.SendKeys "venkatgn"
wait(3)
x.SendKeys "^{s}"
wait(2)
x.SendKeys "file2"
wait(2)
x.SendKeys "{ENTER}"
==================================
'Read data from XML File
Set xd=CreateObject ( "Microsoft.XMLDOM")
xd.Async = "false"
xd.Load ( "e:\GVenkat\book.xml")
For Each b In xmlDoc.selectNodes ( "/Books/Book")
  t= b.selectSingleNode ( "Title"). text
  p=b.selectSingleNode ( "Price"). text
  d=b.selectSingleNode ( "date"). text
  MsgBox "Name:" & t & vbcrlf &"Price:" & p & vbcrlf & "Date " &d
Next
Set xd=nothing
===========================================
'Read Data from Database and save the read data into XML File
Dim cn,rs
Set cn=CreateObject("ADODB.Connection")
Set rs=CreateObject("ADODB.RecordSet")
cn.Open "Provider=SQLOLEDB;Server=sys;database=Northwind;Trusted_Connection=yes"
rs.Open "select employeeid,lastname,firstname,title  from Employees ",cn
rs.Save "e:\r.xml",1

rs.Close
cn.Close

Comments