CraigLazar
asked on
VB.net Get My Documents folder size on Win7
Hi,
I have a small exe that i has a routine in to work out the folder size. I need to work out the folder size of My Documents. Problem is that i think windows 7 security is a problem when my exe runs as it is not picking up the default folder My Documents under c:\Users\Craig\My Documents.
thanks a lot
cheers
I have a small exe that i has a routine in to work out the folder size. I need to work out the folder size of My Documents. Problem is that i think windows 7 security is a problem when my exe runs as it is not picking up the default folder My Documents under c:\Users\Craig\My Documents.
thanks a lot
cheers
You should use: Environment.GetFolderPath( Environmen t.SpecialF older.MyDo cuments)
ASKER
Hi,
I have a class which iterates thru all the folders and sub folders on the c drive, in this process i have a simple If statement using INSTR function to look for My Documents
So it finds no match when i pass it C drive, i then have a My Documents on my D Drive which then my process picks it up.
I have a class which iterates thru all the folders and sub folders on the c drive, in this process i have a simple If statement using INSTR function to look for My Documents
So it finds no match when i pass it C drive, i then have a My Documents on my D Drive which then my process picks it up.
With Win7 (and Vista may be), these folders are difficult to access directly (sometimes even in Explorer). You may have to add special conditions and logic for these folders.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
Thanks so much for the sample code man, it is perfect tweeked it slightly :)
How do you specify the My Documents folder in your code?