reding subfolder in specified folder
Function getfolder (fdrname)
Set fso=createobject ("scripting.filesystemobject")
Set fdr=fso.getfolder(fdrname)
Set frd=fdr.subfolders
If frd.count >0 Then
For each fd in frd
print(fdname & "\" & fd.name)
Next
End If
End Function
getfolder "E:\"
Friday, February 5, 2010
PROGRAM-20
print files in a folder
Set fso=createobject ("scripting.filesystemobject")
Set fdo=fso.getfolder("E:\biswa")
Set flsc=fdo.files
print("no of files:"& flsc.count)
For each fl in flsc
print (fl.name)
Next
Set fso=createobject ("scripting.filesystemobject")
Set fdo=fso.getfolder("E:\biswa")
Set flsc=fdo.files
print("no of files:"& flsc.count)
For each fl in flsc
print (fl.name)
Next
PROGRAM-19
program for reading folders name in folders
Set fso=createobject ("scripting.filesystemobject")
Set ts=fso.getfolder("E:\biswa")
Set fdr=ts.subfolders
For each fd in fdr
print (fd.name)
Next
print("over")
Set fso=createobject ("scripting.filesystemobject")
Set ts=fso.getfolder("E:\biswa")
Set fdr=ts.subfolders
For each fd in fdr
print (fd.name)
Next
print("over")
PROGRAM-18
PROGRAM FOR READING A FILE
Set fso=createobject ("scripting.filesystemobject")
Set ts=fso.opentextfile("E:\biswa\demo.txt")
While not ts.atendofstream
l=ts.readline()
print(l)
Set fso=createobject ("scripting.filesystemobject")
Set ts=fso.opentextfile("E:\biswa\demo.txt")
While not ts.atendofstream
l=ts.readline()
print(l)
PROGRAM-17
WORKING WITH FLIGHT SIMULATOR DATABASE
-------------------------------------------------------
Set db=createobject("ADODB.connection")
db.open "dsn=qt_flight32"
If db.state = 1 Then
msgbox("connected")'
exit test
end if
Set rs=db.execute("select * from Orders")
cc=rs.fields.count
While not rs.eof
rw=""
For i=0 to cc-1
celldata=rs.fields(i).value
rw=rw & vbtab & celldata
Next
print(rw)
rs.movenext
Wend
-------------------------------------------------------
Set db=createobject("ADODB.connection")
db.open "dsn=qt_flight32"
If db.state = 1 Then
msgbox("connected")'
exit test
end if
Set rs=db.execute("select * from Orders")
cc=rs.fields.count
While not rs.eof
rw=""
For i=0 to cc-1
celldata=rs.fields(i).value
rw=rw & vbtab & celldata
Next
print(rw)
rs.movenext
Wend
PROGRAM-16
FINDORDER NUMBER IN RUNTIME
---------------------------------------------
Window("Flight Reservation").Activate
Window("Flight Reservation").WinObject("Date of Flight:").Type "1111111"
Window("Flight Reservation").WinComboBox("Fly From:").Select "Denver"
Window("Flight Reservation").WinComboBox("Fly To:").Select "Paris"
Window("Flight Reservation").WinButton("FLIGHT").ClickWindow("Flight Reservation").Dialog("Flights Table").WinList("From").Select "15835 DEN 12:48 PM PAR 02:48 PM AF $165.60"
Window("Flight Reservation").Dialog("Flights Table").WinButton("OK").Click
Window("Flight Reservation").WinEdit("Name:").Set "hi"Window("Flight Reservation").WinButton("Insert Order").Click
Window("Flight Reservation").ActivateWindow("Flight Reservation").WinButton("Button").Click
Window("Flight Reservation").Dialog("Open Order").Click 29,155Window("Flight Reservation").Dialog("Open Order").WinCheckBox("Order No.").Set "ON"
Window("Flight Reservation").Dialog("Open Order").WinEdit("Edit").Output CheckPoint("Edit")
Window("Flight Reservation").Dialog("Open Order").WinEdit("Edit").Set DataTable("p_Text", dtGlobalSheet)
Window("Flight Reservation").Dialog("Open Order").WinButton("OK").Click
---------------------------------------------
Window("Flight Reservation").Activate
Window("Flight Reservation").WinObject("Date of Flight:").Type "1111111"
Window("Flight Reservation").WinComboBox("Fly From:").Select "Denver"
Window("Flight Reservation").WinComboBox("Fly To:").Select "Paris"
Window("Flight Reservation").WinButton("FLIGHT").ClickWindow("Flight Reservation").Dialog("Flights Table").WinList("From").Select "15835 DEN 12:48 PM PAR 02:48 PM AF $165.60"
Window("Flight Reservation").Dialog("Flights Table").WinButton("OK").Click
Window("Flight Reservation").WinEdit("Name:").Set "hi"Window("Flight Reservation").WinButton("Insert Order").Click
Window("Flight Reservation").ActivateWindow("Flight Reservation").WinButton("Button").Click
Window("Flight Reservation").Dialog("Open Order").Click 29,155Window("Flight Reservation").Dialog("Open Order").WinCheckBox("Order No.").Set "ON"
Window("Flight Reservation").Dialog("Open Order").WinEdit("Edit").Output CheckPoint("Edit")
Window("Flight Reservation").Dialog("Open Order").WinEdit("Edit").Set DataTable("p_Text", dtGlobalSheet)
Window("Flight Reservation").Dialog("Open Order").WinButton("OK").Click
PROGRAM-15
datatable.Importsheet "E:\satya\AMULYA.xls",1,global
OR
datatable.Import "E:\satya\AMULYA.xls"
OR
datatable.Import "E:\satya\AMULYA.xls"
Friday, January 29, 2010
PROGRAM-14
PROGRAM TO ADD COLUMN TO NEW SHEET ADDED
Set cds=datatable.AddSheet("cities")
Set cnp=cds.addparameter("cityname","blr")
For i=2 to 4
x=inputbox("enter city name")
cnp.valuebyrow(i)=x
Next
Set cnp2=cds.addparameter("state","kna")
For j=2 to 4
y=inputbox("enter state name")
cnp2.valuebyrow(j)=y
next
datatable.ExportSheet "E:\satya\amul.xls","cities"
Set cds=datatable.AddSheet("cities")
Set cnp=cds.addparameter("cityname","blr")
For i=2 to 4
x=inputbox("enter city name")
cnp.valuebyrow(i)=x
Next
Set cnp2=cds.addparameter("state","kna")
For j=2 to 4
y=inputbox("enter state name")
cnp2.valuebyrow(j)=y
next
datatable.ExportSheet "E:\satya\amul.xls","cities"
PROGRAM-13
PROGRAM TO ADD ONE EXCEL SHEET TO DATA TABLE AND EXPORT IT
Set cds=datatable.AddSheet("cities")
Set cnp=cds.addparameter("cityname","blr")
For i=2 to 4
x=inputbox("enter city name")
cnp.valuebyrow(i)=x
wait(2)
Next
datatable.ExportSheet "E:\satya\amul.xls","cities"
Set cds=datatable.AddSheet("cities")
Set cnp=cds.addparameter("cityname","blr")
For i=2 to 4
x=inputbox("enter city name")
cnp.valuebyrow(i)=x
wait(2)
Next
datatable.ExportSheet "E:\satya\amul.xls","cities"
PROGRAM-12
PROGRAM FOR READING ALL TABS FROM MYCOMPUTER PROPERTIES
tc=dialog("System Properties").WinTab("SysTabControl32").GetItemsCount()
For i=0 to tc-1
tname=dialog("System Properties").WinTab("SysTabControl32").GetItem(i)
dialog("System Properties").WinTab("SysTabControl32").Select tname,micLeftBtn
wait(1)
Next
tc=dialog("System Properties").WinTab("SysTabControl32").GetItemsCount()
For i=0 to tc-1
tname=dialog("System Properties").WinTab("SysTabControl32").GetItem(i)
dialog("System Properties").WinTab("SysTabControl32").Select tname,micLeftBtn
wait(1)
Next
Wednesday, January 27, 2010
program-11
PROGRAM FOR READING GMAIL TABLE
rowcount=browser("Gmail - Inbox - mailto:amulya.dhal@gm - Inbox - mailto:amulya.dhal@gm
For i=1 to rowcount
colcount=browser("Gmail - Inbox - mailto:amulya.dhal@gm - Inbox - mailto:amulya.dhal@gm)
rowdata=""
For j=1 to colcount
celldata=browser("Gmail - Inbox - mailto:amulya.dhal@gm - Inbox - mailto:amulya.dhal@gm)
rowdata= rowdata & vbtab & celldata
print(celldata)
Next
'print(celldata)
next
rowcount=browser("Gmail - Inbox - mailto:amulya.dhal@gm - Inbox - mailto:amulya.dhal@gm
For i=1 to rowcount
colcount=browser("Gmail - Inbox - mailto:amulya.dhal@gm - Inbox - mailto:amulya.dhal@gm)
rowdata=""
For j=1 to colcount
celldata=browser("Gmail - Inbox - mailto:amulya.dhal@gm - Inbox - mailto:amulya.dhal@gm)
rowdata= rowdata & vbtab & celldata
print(celldata)
Next
'print(celldata)
next
program-10
PROGRAM TO SEARCH IN GOOLGE
browser("Google").Page("Google").WebEdit("search").Set "india"
browser("Google").Page("Google").WebButton("Google Search").Click
browser("Google").Page("Google").WebEdit("search").Set "india"
browser("Google").Page("Google").WebButton("Google Search").Click
program-9
PROGRAM TO FINDOUT PRIME NUMBER
i=inputbox("enter starting value " )
j=inputbox ("enter end value" )
For n=i to j
If n mod 2<>0 Then
print(n)
End If
i=inputbox("enter starting value " )
j=inputbox ("enter end value" )
For n=i to j
If n mod 2<>0 Then
print(n)
End If
Sunday, January 24, 2010
program-8
PROGRAM FOR PRINTING THE CONTENT IN LOCATION OF GMAIL SIGN UP
****************************************************************************
ic=browser("Google Accounts").Page("Google Accounts").WebList("loc").GetROProperty("items count")
print(ic)
For i=1to ic
iname=browser("Google Accounts").Page("Google Accounts").WebList("loc").GetItem(i)
print(iname)
Next
****************************************************************************
ic=browser("Google Accounts").Page("Google Accounts").WebList("loc").GetROProperty("items count")
print(ic)
For i=1to ic
iname=browser("Google Accounts").Page("Google Accounts").WebList("loc").GetItem(i)
print(iname)
Next
program-7
PROGRAM FOR PRINTING THE CONTENT IN SECURITY QUESTION OF GMAIL SIGNUP
***********************************************************************************
ic=browser("Google Accounts").Page("Google Accounts").WebList("selection").GetROProperty("items count")
print(ic)
For i=1to ic
iname=browser("Google Accounts").Page("Google Accounts").WebList("selection").GetItem(i)print(iname)
Next
program-6
HOW TO PRESS ENTER TO MYCOMPUTER IN START BUTTON
*************************************************************
ic=window("Window").WinButton("start").press
Set kb=createobject ("wscript.shell")
kb.sendkeys "{up}"
wait(1)
kb.sendkeys "{up}"
wait(1)
kb.sendkeys "{up}
"wait(1)
kb.sendkeys "{up}
"kb.sendkeys "{up}"
kb.sendkeys "{up}"
kb.sendkeys "{up}"
kb.sendkeys "{up}"
wait(1)
kb.sendkeys "{up}"
kb.sendkeys "{enter}"
*************************************************************
ic=window("Window").WinButton("start").press
Set kb=createobject ("wscript.shell")
kb.sendkeys "{up}"
wait(1)
kb.sendkeys "{up}"
wait(1)
kb.sendkeys "{up}
"wait(1)
kb.sendkeys "{up}
"kb.sendkeys "{up}"
kb.sendkeys "{up}"
kb.sendkeys "{up}"
kb.sendkeys "{up}"
wait(1)
kb.sendkeys "{up}"
kb.sendkeys "{enter}"
program-5
PROGRAM TO EXIT IDM FROM BOTTM RIGHT CORNER OF DESKTOP
ic=window("Window").WinToolbar("Notification Area").GetItemsCount()
For i=1 to ic
iname=window("Window").WinToolbar("Notification Area").GetItem(i)
If iname="Internet Download Manager" Then
window("Window").WinToolbar("Notification Area").Press iname,micRightBtn
End If
Next
wait(1)
Set kb=createobject ("wscript.shell")
kb.sendkeys "{up}"
wait(1)
kb.sendkeys "{enter}"
ic=window("Window").WinToolbar("Notification Area").GetItemsCount()
For i=1 to ic
iname=window("Window").WinToolbar("Notification Area").GetItem(i)
If iname="Internet Download Manager" Then
window("Window").WinToolbar("Notification Area").Press iname,micRightBtn
End If
Next
wait(1)
Set kb=createobject ("wscript.shell")
kb.sendkeys "{up}"
wait(1)
kb.sendkeys "{enter}"
program-4
PROGRAM TO EXIT YAHOO MESSENGER FROM BOTTM RIGHT CORNER OF DESKTOP
*********************************************************************************
ic=window("Window").WinToolbar("Notification Area").GetItemsCount()
For i=1 to ic
iname=window("Window").WinToolbar("Notification Area").GetItem(i)
If iname="Yahoo! Messenger" Then
window("Window").WinToolbar("Notification Area").Press iname,micRightBtn
End If
Next
wait(1)
Set kb=createobject ("wscript.shell")
kb.sendkeys "{up}"
wait(1)kb.sendkeys "{enter}"
*********************************************************************************
ic=window("Window").WinToolbar("Notification Area").GetItemsCount()
For i=1 to ic
iname=window("Window").WinToolbar("Notification Area").GetItem(i)
If iname="Yahoo! Messenger" Then
window("Window").WinToolbar("Notification Area").Press iname,micRightBtn
End If
Next
wait(1)
Set kb=createobject ("wscript.shell")
kb.sendkeys "{up}"
wait(1)kb.sendkeys "{enter}"
program-3
PROGRAM TO ACCESS THE PROCESS NAME IN RIGHT MOST BOTTOM OF DESKTOP
*********************************************************************************
ic=window("WINDOW").WinToolbar("Notification Area").GetItemsCount()
For i=1 to ic
it=window("WINDOW").WinToolbar("Notification Area").GetItem(i) print(it)
Next
*********************************************************************************
ic=window("WINDOW").WinToolbar("Notification Area").GetItemsCount()
For i=1 to ic
it=window("WINDOW").WinToolbar("Notification Area").GetItem(i) print(it)
Next
program-2
PROGRAM TO ACCESS THE DESKTOP
***************************************
ic=window("Program Manager").WinListView("SysListView32").GetItemsCount()
For i=0 to ic-1
it=window("Program Manager").WinListView("SysListView32").GetItem(i) print(it)
Next
***************************************
ic=window("Program Manager").WinListView("SysListView32").GetItemsCount()
For i=0 to ic-1
it=window("Program Manager").WinListView("SysListView32").GetItem(i) print(it)
Next
Program-1
PROGRAM TO GET ITEMS BELOW IN WINDOW TOOLBAR OF DESKTOP
***********************************************************************
ic= window("Window").WinToolbar("Running Applications").GetItemsCount()
For i=1 to ic
it=window("Window").WinToolbar("Running Applications").GetItem(i)print(it)
Next
***********************************************************************
ic= window("Window").WinToolbar("Running Applications").GetItemsCount()
For i=1 to ic
it=window("Window").WinToolbar("Running Applications").GetItem(i)print(it)
Next
Subscribe to:
Posts (Atom)