Get file size using wmi
Hi, Sorry but I think it's impossible to do this only with wmi query even complex. The problem is that the WMI objects don't store directory size as a property of a single object; directory size is calculated by summing file sizes recursively. Unless your vendor item can take a scipt you are out of luck.
Some products allow you to specify a script to resolve a value. Someonly allow a singleWMI query. Office Office Exchange Server. Not an IT pro? Script Center. Sign in. United States English. Ask a question. Quick access. What could take multiple guys 2 hours or more each to find is accessed in around 15 minutes on Experts Exchange.
All rights reserved. Covered by US Patent. Come for the solution, stay for everything else. Welcome to our community!
I am working on a script that utilizes WMI to get the size of a particular file. So far, it doesn't appear to be even looking in the directory -- I receive 0 files found can any one tell why this isn't returning any file count. Join our community to see this answer! Unlock 1 Answer and 8 Comments. Generic; using System. Management; using System. Equals "localhost", StringComparison.
WriteLine String. WriteLine "Press Enter to exit" ; Console. Improve this answer. Helen I am not getting folder size by using the above code. Please help as I need this urgently — Anoop. Please check these suggestions 1. Are you modified the code in any way?
Are you aware which this code is not recursive? Sign up or log in Sign up using Google. Sign up using Facebook.
0コメント