Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
folder size
#1
is there a way to get folder size like there is for files?
this keeps coming up "0".

Code:
Copy      Help
Dir d
foreach(d "C:\*" FE_Dir 0x1)
,str sPath=d.FileName(1)
,out sPath
,int s_ize=d.FileSize
,out s_ize
An old blog on QM coding and automation.

The Macro Hook
#2
Code:
Copy      Help
Wsh.FileSystemObject fso._create
Wsh.Folder f=fso.GetFolder(_s.expandpath("$desktop$"))
long i=f.Size
out i

Or calculate sum of all files.
#3
works great!
thanks.
An old blog on QM coding and automation.

The Macro Hook
#4
It used to work.

I tried it today (2.3.1.3) it aborts with real time error "0x80020008, Bad variable type".

I understand the variable type is now changed to double?
#5
Bug in VARIANT to long conversion in QM 2.3.1. Will be fixed in 2.3.1.5. Thank you.

For this purpose QM also has function GetFileOrFolderSize.
#6
Gintaras,

Thanks. Yes as a matter of principle I use GetFileOrFolderSize, except in one unique macro where I used GetFolder property.

Regards

Simos


Forum Jump:


Users browsing this thread: 1 Guest(s)