Skip to main content
Announcements
Qlik Connect 2025: 3 days of full immersion in data, analytics, and AI. May 13-15 | Orlando, FL: Learn More
cancel
Showing results for 
Search instead for 
Did you mean: 
chiru_thota
Specialist
Specialist

Is there a simple way to find just disk space (size) from QlikView script?

Hi All,

Is there anyway to find just disk size from QlikView. We are not interested to know sub folders,QVW sizes etc.

We just need Disk size (currently filled)

Thanks,

Chiru.

1 Solution

Accepted Solutions
stevedark
Partner Ambassador/MVP
Partner Ambassador/MVP

Your code is missing out the create object line.  Also, the : should not be there in the IF statement.


The macro code should look like this:

sub x

set fso = CreateObject("Scripting.FileSystemObject")

For Each LW In fso.Drives

  if LW.DriveLetter = "C" then

          msgbox(LW.DriveLetter & ": " & LW.AvailableSpace / 1000000 & " MB")

  end if

next

end sub

Also, you don't presently have a way of firing the macro.  You need to add a button and set an Action on it, of type External, Run Macro and set the Macro Name to x.

I've attached an updated copy.

Steve

View solution in original post

21 Replies
Peter_Cammaert
Partner - Champion III
Partner - Champion III

Is there a simple way...   I don't think so, sorry. However there are various ways to get the (free) disk space of a specific drive using various forms of coding.

chiru_thota
Specialist
Specialist
Author

Can we write macro to find out the disk space by any chance in QlikView ?

marcus_sommer

The following is adapted from here: mit VBA Laufwerksinformationen ermitteln and worked:

sub x

set fso = CreateObject("Scripting.FileSystemObject")

For Each LW In fso.Drives

    msgbox(LW.DriveLetter & ": " & LW.AvailableSpace / 1000000 & " MB")

next

end sub

- Marcus

chiru_thota
Specialist
Specialist
Author

Thanks Marcus.Need your help with syntax.

Can you give syntax If I want to find C:\  disk space in windows machine.

Chiru

marcus_sommer

Try this:

For Each LW In fso.Drives

    if LW.DriveLetter = "C:" then

          msgbox(LW.DriveLetter & ": " & LW.AvailableSpace / 1000000 & " MB")

     end if

next

- Marcus

chiru_thota
Specialist
Specialist
Author

Thanks Marcus and really appreciate your help.

Code is executing fine .But it is not giving me any out put.

Attaching sample QVW here.

Chiru !

stevedark
Partner Ambassador/MVP
Partner Ambassador/MVP

Your code is missing out the create object line.  Also, the : should not be there in the IF statement.


The macro code should look like this:

sub x

set fso = CreateObject("Scripting.FileSystemObject")

For Each LW In fso.Drives

  if LW.DriveLetter = "C" then

          msgbox(LW.DriveLetter & ": " & LW.AvailableSpace / 1000000 & " MB")

  end if

next

end sub

Also, you don't presently have a way of firing the macro.  You need to add a button and set an Action on it, of type External, Run Macro and set the Macro Name to x.

I've attached an updated copy.

Steve