Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
"How to Count Desktop Icons"
#1
Not Solved
Hi Folks,

I have lot of Icons my Desktop, I need total count of icons and verify that particular file/folder/etc are present on my desktop or not?
Reply
#2
Not Solved
Hi Suresh,

'get the desktop item count
Code:
intCount=Window("title:=Program Manager").WinListView("object class:=SysListView32").GetItemsCount
msgbox intCount

I am still trying to get the items for validation/verification. I will keep you posted.

Regards,
Ankesh
Reply
#3
Not Solved
Hi Ankesh,

First of all thanks for your reply, I tried your code but I got the error like type mismath.
Hi Ankesh,

Sorry for the previous post it's working fine.Now I need to print the name of each icon present on desktop can you please send the code to me.
Reply
#4
Not Solved
Hi Suresh,

Usually the below code works fine to get the items

Code:
strItems=Window("title:=Program Manager").WinListView("object class:=SysListView32").GetROProperty("all items")

but for me "all items" property is blank. Can you plz post the snapshot of object spy by spying any of the icon on the desktop?

Regards,
Ankesh
Reply
#5
Not Solved
I am not sure of your requirement. You can use VBScript to get this done.
Code:
Set fso = createobject("Scripting.FileSystemObject")
DesktopPath = CreateObject("WScript.Shell").SpecialFolders("Desktop")

'Files count
msgbox fso.GetFolder(DesktopPath).Files.Count

'Folders count
msgbox fso.GetFolder(DesktopPath).SubFolders.Count

'Check if specified file is present
msgbox fso.FileExists(DesktopPath & "\" & "qtp.txt")

'Check if specified folder is present
msgbox fso.FolderExists(DesktopPath & "\" & "DSC_019612")
Reply
#6
Not Solved
Hi vIns,

I am getting the count of Desktop Icons but I need the names of Ecah icon present on Desktop.If you know please share code with me and along with Ankesh.
Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
  Can't locate items on Win7 Desktop RandomGrin 0 1,976 01-30-2015, 10:55 PM
Last Post: RandomGrin
  Dialog box error while QTP scripts run from VM Desktop rahuldps 2 4,517 11-14-2011, 01:47 PM
Last Post: ravi.gajul
  Unable to login with the same code in different desktop vnsk 2 2,812 10-19-2011, 06:26 PM
Last Post: vnsk
  Write a program to Capture Desktop Screen shot kumarmoyilla 2 11,456 07-11-2011, 10:51 AM
Last Post: souvikghosh_diatm
  How we can Identified Costume control in .Net Desktop application atulsapas 0 1,764 10-04-2010, 03:37 PM
Last Post: atulsapas

Forum Jump:


Users browsing this thread: 1 Guest(s)