List unused files




















To insert the list of the physical location of in temp table, we must create a dynamic T-SQL query that uses the drive letters stored in tbldrive and create a dir command. The following code generates the dir command. Now, as mentioned, we will insert the output of the command in tblFiles. To do that, add the following T-SQL query block in the while loop.

Output of the list of physical location of the mdf and ldf file are the following:. Following is the code:. Now, to display the output in email, we will use HTML code. The data type of the variable is nvarchar max. To send the email, we will use the SQL Server database mail. I have already created a database mail profile named OutlookMail.

The code to email the list of unused database files is as following:. Click on Steps and click on New to create a job step. Click OK to save the step and close the dialog box. We will schedule the execution of this job every week on Monday at AM; therefore, configure the schedule accordingly. To do that, click on Schedules in the New Job dialog box. If you are running the latest Windows 10, you can utilize the Storage Sense feature to clean junk files automatically.

Not only junk files, but you can also configure storage sense to clean your recycle bin in a set time. Hence, in this article, we will list down some of the best ways to automatically clean Windows of unused files. The methods shared below were easy to implement. Well, Storage Sense is a built-in feature of Windows 10 that lets you free up storage space. Step 1. Step 2. On the Settings app, click on the System option as shown below. Step 4. Enable the Storage Sense feature as shown in the screenshot.

Next, click on the Configure Storage Sense or run it now link. Step 5. Step 6. Now select the number of days you want recycle bin to store your deleted files. Step 7. If you are running sort of storage, click on the Clean now option on the Free up Space now section. There are many tools available on the internet that can clean all the junk files stored on the Windows operating system for you.

However, you can also use notepad to clean all junk files, eliminating a third-party tool. CrazyCoder CrazyCoder k gold badges silver badges bronze badges. Just a correction for future readers: IDEA CrazyCoder This shows unused fields and methods too, any way to show only unused classes?

My 2 cents: on IntelliJ Or, maybe, you can do it during the work hours and say to your boss that you're running an analyzer BenClayton and the rest, looking just for unused classes If you are trying to find unused methods in a Kotlin project, run the Unused symbol inspection. Looks like the Unused declaration only works in Java projects.

Show 1 more comment. Johnny Johnny Don't forget to hit Do Refactor afterwards. Orwellophile Orwellophile The Overflow Blog. Stack Gives Back Safety in numbers: crowdsourcing data on nefarious IP addresses. Featured on Meta. New post summary designs on greatest hits now, everywhere else eventually.



0コメント

  • 1000 / 1000