none
Getting File Size info in BGinfo

    Question

  • Hi all,

    I am trying to get file size info of a particular file on the local drive.
    I am adding a Custom class within BGInfo.
    Now when i choose the WMI Query i can't choose the CIM_DataFile Class since only the Win32 query's are available.

    Can anyone help me out?
    Thursday, March 10, 2016 10:44 AM

Answers

  • > Now when i choose the WMI Query i can't choose the CIM_DataFile Class
    > since only the Win32 query's are available.
     
    Why not? Simply type yor query into the query field... This one worked
    for me in a quick test:
     
    select filesize from cim_datafile where name="c:\\username.txt"
     
    Friday, March 11, 2016 11:21 AM

All replies

  • Hi,
    As far as I know, BGInfo is used to relevant information about a Windows computer on the desktop's background, such as the computer name, IP address, service pack version and can’t get the size of a particular file on the local drive.
    And my test in my lab environment showed the same result, so I would not suggest to use it to get the file size.
    You could have a try PowerShell script, please take a look the following article and try it:
    https://technet.microsoft.com/en-us/library/ff730948.aspx
    Regards,
    Wendy

    Please remember to mark the replies as answers if they help and un-mark them if they provide no help. If you have feedback for TechNet Subscriber Support, contact tnmff@microsoft.com.

    Friday, March 11, 2016 9:34 AM
    Moderator
  • > Now when i choose the WMI Query i can't choose the CIM_DataFile Class
    > since only the Win32 query's are available.
     
    Why not? Simply type yor query into the query field... This one worked
    for me in a quick test:
     
    select filesize from cim_datafile where name="c:\\username.txt"
     
    Friday, March 11, 2016 11:21 AM
  • Thanks Martin!

    Did the trick. I thought it was manditory to fill in a WMI Class.

    Kind regards,

    Marijn
    Friday, March 11, 2016 1:19 PM