Analysis number of file on desktop

(imported topic written by GaelMace)

Hello all,

I’m looking for a way to get the number of files on the desktop folder and subfolders of each profile (c:\documents and settings…\desktop), and le size of the folder.

Lots of users connect on PCs, i was asked to get these informations.

Ii succeded in getting the size of the desktop of each profile on XP computers

(pathnames of it ,((sum of sizes of descendants of it)/1024) as string & " MB") of folders “Desktop” of folders of folder “c:\documents and settings”, it shows me each the path of each desktop profile and the size, and I’d like to get the same for the number of file in the desktop folder and subfolders.

I tried this, but it’s not working : (pathnames of it, number of files of (folders it; descendant folders of it)) of folder “Desktop” of folders of folder “c:\documents and settings”

Thanks for you help

(imported comment written by JasonWalker)

folder “Desktop” is a multiple result, so it needs to be folders “Desktop”, and with “
(folders it; descendant folders of it)”, “it” already refers to the Folder object so it should just be “
(it; descendant folders of it)

Also, this assumes “c:\documents and settings” and not the Win7 style “c:\users”, so take care. Here’s my version on Win7:

(pathnames of it, number of files of (it; descendant folders of it)) of folders “Desktop” of folders of folder “c:\users”

q: (pathnames of it, number of files of (it; descendant folders of it)) of folders “Desktop” of folders of folder “c:\users”

A: c:\users\All Users\Desktop, 0

A: c:\users\Default\Desktop, 0

A: c:\users\Holden\Desktop, 16

A: c:\users\Jason\Desktop, 102

A: c:\users\Public\Desktop, 8

(imported comment written by GaelMace)

Sorry I finally succed in finding some time to test it

Thank you it works perfectly for Win7 and XP

(imported comment written by TheTick)

Just a comment/recommendation.

I would look at doing this in two steps depending on how often and long this analysis will be running. The first step would be an action that outputs the information to a text file and the second would be an analysis to collect the output of the action. The reason is that this could take a very long time to run on a target which could impact reporting.

As an example, when I run the above through the fixlet debugger,

q: (pathnames of it, number of files of (it; descendant folders of it)) of folders “Desktop” of folders of folder “c:\users”

A: c:\users\Administrator\Desktop, 5

A: c:\users\All Users\Desktop, 0

A: c:\users\Default\Desktop, 0

A: c:\users\martin\Desktop, 1198

A: c:\users\Public\Desktop, 9

A: c:\users\UpdatusUser\Desktop, 3

T: 5043.080 ms <-Time it takes when using the local client evaluator

T: 321.281 ms <- Time it takes when using the local fixlet debug evaluator

Big difference and if running on a regular basis, could impact your environment. But this is a “could” not “will”

Martin