DIAdem

cancel
Showing results for 
Search instead for 
Did you mean: 

How to count the occurrence of folder in a User directory?

Solved!
Go to solution

Hi,

 

Isit possible to write a code that allows me to count the number of occurrence of a specific folder name in my User directory? For instance I would like to count the number of folder name "New folder" in my directory. Currently, I'm trying to modify the subfolder count codes but have failed to be able to count a specific folder name. Thanks in advance.

 

Regards,

Zamir

0 Kudos
Message 1 of 5
(3,018 Views)

Hi Zamir,

 

Is this a question you want to solve with a DIAdem VBScript?  Are you looking in one folder only, or are you also looking in all that folder's subfolders?  Are you looking for a folder name that exactly equals "New folder", or are you looking for any folders that have a name starting with that text or have that text somewhere inside the folder name?

 

Brad Turpin

DIAdem Product Support Engineer

National Instruments

0 Kudos
Message 2 of 5
(2,983 Views)

Hi Brad,

Apologies for the unclear question. Yes. I'm trying to solve this using a VBScript. So basically, Im trying to get the script to search for folders and subfolders on the desktop with the specific name. For instance, on my desktop i have 2 folders. Named "Folder 1" and "Folder 2". Within each folder there is a folder named "New Folder". So the script would specify the path to search on my desktop for the specific folder name "New Folder" and return the value. 

Apologies if my english is rather poor. Hope its clearer and that you can post an approach for the solution.

 

Thank you.

 

Zamir

0 Kudos
Message 3 of 5
(2,967 Views)
Solution
Accepted by topic author nzamir91

Hi Zamir,

 

This isn't a simple script, but it appears to do what you want.  Let me know what you think and if you have any questions.

 

Brad Turpin

DIAdem Product Support Engineer

National Instruments

Message 4 of 5
(2,938 Views)

Hi Brad,

 

Thanks alot for all your help. Much appreciated. Will let you know of any issues. 

 

Thanks again.

 

Regards,

Zamir

0 Kudos
Message 5 of 5
(2,933 Views)