This will greatly improve the performance of the script (especially when gathering inboxes information across the WAN link). When this is done, Get-ChildItem can be used and executed locally on each site servers and eliminate the needs for DIRUSE.EXE. I’ll get this done in the next few weeks and post it here once it’s done. The Windows NT Resource Kit includes DIRUSE which will give you disk usage by drive, folder, or sub-folders. DIRUSE displays the number of folders, files and space consumed.
How to find the size of a file
In Windows, we can use dir command to get the file size.
But there is no option/switch to print only the file size.
Get size for all the files in a directory
Dir command accepts wild cards. We can use ‘*” to get the file sizes for all the files in a directory.
Vivitar image manager mac download. We can also get size for files of certain type. For example, to get file size for mp3 files, we can run the command ‘dir *.mp3‘.
The above command prints file modified time also. To print only the file name and size we can run the below command from a batch file.
Save the above commands to a text file, say filesize.bat, and run it from command prompt.
Get directory size
There’s no Windows built in command to find directory size. But there is a tool called diruse.exe which can be used to get folder size. This tool is part of XP support tools. This command can be used to get directory size. This command’s syntax is given below.
As you can see in the above example, diruse prints the directory size in bytes and it also prints the number of files in the directory(it counts the number of files in the sub folders also)
To get the directory size in mega bytes we can add /M switch.
Diruse.exe
Though the tool is intended for XP and Server 2003, I have observed that it works on Windows 7 also. The above examples were indeed from a Windows 7 computer.