?
Solved

To find the free disk space of a particular folder and to delete old files using PowerShell and Java

Posted on 2016-09-19
2
Medium Priority
?
45 Views
Last Modified: 2016-10-18
To find the free space of a particular folder/folders
 and to delete old files if that folder exceeds a particular threshold size limit.
It should work on local machine as well as remotely.

Can anyone please help in this regard.
0
Comment
Question by:Kartheek M
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
2 Comments
 
LVL 30

Accepted Solution

by:
serialband earned 2000 total points
ID: 41805136
You don't find free space on folders.  Free space exists on Disks.  I don't know the powershell, way since I've always just used the command line.

You can use the built in fsutil with psexec
psexec \\Computer fsutil volume diskfree c:

You can also use wmic
wmic /node:"%COMPUTERNAME%" LogicalDisk Where DriveType="3" Get DeviceID,FreeSpace

If you have multiple disks, you can use find to isolate the disk.
wmic /node:"%COMPUTERNAME%" LogicalDisk Where DriveType="3" Get DeviceID,FreeSpace|find /I "c:"
0

Featured Post

VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

A solution for Fortify Path Manipulation.
New style of hardware planning for Microsoft Exchange server.
This Micro Tutorial will give you a basic overview of Windows DVD Burner through its features and interface. This will be demonstrated using Windows 7 operating system.
In this video, viewers are given an introduction to using the Windows 10 Snipping Tool, how to quickly locate it when it's needed and also how make it always available with a single click of a mouse button, by pinning it to the Desktop Task Bar. Int…
Suggested Courses

765 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question