Posts Tagged ‘delete’

The aim of this guide is to create a folder whose content is deleted if the contained files have not been accessed longer than a specific time (this process is applied to single files, not the whole folder). I will choose two weeks for demonstration purposes (= 14 days). Such a folder can be used as temporary folder of any kind, be it for downloaded files/installers or to just keep the desktop clutter-free.
This can be achieved with a combination of PowerShell script and Windows task scheduler. The folder that I will use for this will be C:\Users\howtoforge\Desktop\Temp and is located on my desktop for easy access. To keep order to it, create another folder for your custom scripts if you haven’t already got one, mine will be C:\Scripts.
Open a new instance of notepad and save it in your scripts folder as delete_temp.ps1. .ps1 is the file extension for PowerShell scripts. Now enter following into the script:

cd “C:\Users\howtoforge\Desktop\Temp”;
Get-Childitem | Foreach-Object {if ($_.LastAccessTime -le (get-date).adddays(-14)) {remove-item -recurse -force $_}};

Save the script again. What it does: the script changes into the directory that we want to observe, looks at its items and then deletes every one whose last access time is older than 14 days recursively (it only looks at the items directly placed in the folder, not at subdirectories). The time interval is specified in the adddays attribute of the get-date function here (which can also be addmonths, addhours, etc…) and is a negative number to actually subtract the number of days from the present date. You can change it to your likings.
The script being ready, you have to configure PowerShell to enable calling scripts – therefore open an elevated command line (search the menu for cmd, right-click and select Run as administrator). Open PowerShell by entering

powershell

Afterwards, enter

Set-ExecutionPolicy RemoteSigned

to enable calling scripts. Now you can test your script by right-clicking it and selecting Run with PowerShell. If nothing goes wrong (no red text in the flashing window), proceed to schedule the task, otherwise check your script for errors.

To schedule the task, open Control Panel > System and Security > Administrative Tools > Schedule Tasks. On the left pane, select Task Scheduler Library, then right-click the central task-list and select Create New Task.
On the General tab, give the task a name and a description. Furthermore, choose your version of Windows and optionally choose to run it with highest privileges.
The Trigger tab defines what will call the script – hit New and choose one or more of the various possibilities and events. I choose to run the script when the machine goes idle, since the script will blink up in a PowerShell window when called, and I don’t want that to disturb my work (although it’s really only a split second if you don’t delete several GB of files).
On the Actions tab you define what to do – hit New again. Now don’t enter the actual script as program to run – this goes to the Add arguments line (enter the full path here). What you need to do is to call the PowerShell executable with the script as an argument. I use PowerShell 1.0 which is located in C:\Windows\System32\WindowsPowerShell\v1.0\powershell.exe – enter this path into the Program/script line and hit OK.
Now configure the next two tabs for your needs and hit OK again to create the task.

The selected folder will then be scanned for files that haven’t been accessed for longer than the given period every time the task triggers.

Properly Uninstall Software on Windows with Revo Uninstaller

Tuesday, January 3, 2012 posted by CSch

The built-in Windows tool to add and remove software is commonly used to install and uninstall software, in most cases an own uninstaller comes with the program. However, this uninstaller usually does its job quite sloppy, since numerous files, folders and/or registry entries are left behind after installation. This can either be wanted, if the left files serve as configuration preservers for the case of reinstallation of the program or, as it is in most cases, is just taken lightly by the programmers, meaning that the left files are actually only data junk never to be used again.
This data junk, if stored in masses, can slow down your computer over time. While the best method to get rid of it is to format your hard drive and reinstall the operating system from time to time, you may have reasons to not do that, but to look for a more immediate way to get rid of or to prevent such installation leftovers.
One way to uninstall software more effectively as with their own uninstaller is doing so with Revo Uninstaller.

This piece of software provides multiple steps of uninstalling – it first removes the programs with their own uninstaller and then scans the system for the so-called software rot.

If any leftover files are found, they are shown and you are given the option to delete them seperately. Only delete the files that you are sure you won’t need anymore – deleting files you don’t know or recognize can cause severe problems.

Furthermore, Revo Uninstaller comes with a bunch of useful features as emptying browser caches, deleting temporary files, Windows search queries, several histories and erasing all tracks of deleted files.

Permanently Delete Files (Windows)

Thursday, December 8, 2011 posted by CSch

To permanently delete files instead of just throwing them into the waste-bin with Del, select them and press Shift and Del simultaneously. Confirm the appearing dialogue and you’ll have made sure that your trash does not overflow with forgotten data:

Remove Erroneous Firefox Configuration Entry (Windows 7)

Tuesday, December 6, 2011 posted by CSch

If you entered an erroneous entry into the about:config database of Mozilla Firefox, you will have noticed that there is no option in the browser itself that enables you to remove that entry. Instead, find the config file in your desktop explorer:

C:\Users\YourUsername\AppData\Roaming\Mozilla\Firefox\Profiles\weirdstring\prefs

YourUsername has to be replaced with the name of the user you’re logged in with and weirdstring is a string consisting to mainly numbers which represents your Firefox profile. Edit the prefs file with notepad, track down the entry you want to delete and erase the full line.

Clear Firefox Browser Cache

Tuesday, November 22, 2011 posted by CSch

Browser Cache (or Internet Cache) is there to speed up your browser performance by saving sites and items you visited on the internet on your hard disk and recalling them when you visit them again. However there may be times when you want to delete that cache because it either consumes too much disk space (its size can easily climb to 500MB and more) or you do not want someone who has access on your computer to see what sites you visited. In Firefox there is a simple solution for this. Click on the main button and open the Options window:

Select Advanced and go to the Network tab.

The Offline Storage section shows you how large your cache is at the moment. Here you can use the Clear Now button to delete your cache.

If you stayed loyal to Firefox 3.6, go to Edit > Preferences instead.

Unlock and Delete Any File (Windows)

Friday, October 14, 2011 posted by CSch

Sometimes it is necessary to just put a file that does not want as you want in the trash can. And sometimes doing this simple thing is not possible, because the file is being used by another program or is bound to other processes . If this is the case, the file is treated as if it was “locked” and changes cannot be done to it. If you are sure that the file needs to be deleted anyway, there is a tool called Unlocker that is able to cut off any file from its bonds so that it can be moved, renamed or even deleted. This can be pretty handy if your computer too stubborn to see its mistakes.

Unlocker is available for both 32 bit and 64 bit systems on the emptyloop homepage: http://www.emptyloop.com/unlocker/#download

To be able to use Unlocker with a rightclick, make sure that the Explorer extension is checked during the installation process.
To delete files afterwards, rightclick them and select Unlocker. The opening window will tell you if the selected file is locked or not and gives you the option to move, rename or delete it instantly.

Clean Up Your Windows System (CCleaner)

Wednesday, October 12, 2011 posted by CSch

The common computer user often does not know that a simple uninstall of a software he or she is no longer in need of will not erase the program completely but will leave traces on your hard disk. These may stack up to a fairly high size and can slow your computer down. The same goes for all kind of temporary files your system stores, the most common being temporary internet files. Deleting these files manually can be a hard thing to do, especially if you do not know where to find those and how to recognize them. That is why there are plenty of tools on the internet that allow you to search for and erase them automatically.
One of these helpful tools is CCleaner.

CCleaner is a tool that allows you to clean up your Windows Registry (the key storage that is responsible for every kind of configuration on your system), uninstall software properly without leaving any traces, disable autostart processes, delete all kinds of temporary files and even format your hard drives and overwrite them up to 35 times so that your old files will no longer be accessible by any usual means.

CCleaner for Windows can be downloaded here: http://download.piriform.com/ccsetup311.exe
It is also available for Mac on: http://download.piriform.com/mac/CCMac1.00.077.dmg

CCleaner’s menu is divided into four main options, being Cleaner, Registry, Tools and Options. The Cleaner section is there for deleting temporary files, cookies, recent documents and other stored files of that kind. The Registry section searches the registry for disposable entries such as missing shared DDLs, unused file extensions or obsolete software and gives you the option to delete these entries. In the Tools section you can uninstall software, delete system restore points and wipe your hard drives empty. Options, speaking for itself, lets you configure your settings, mainly to include or exclude data from being deleted.

How to Clean Up Unnecessary Files with Bleachbit (Linux Mint)

Friday, September 23, 2011 posted by CSch

Everyone knows the problem of previous installations leaving behind loads of data rubbish on your computer and you may know how hard it can be to remove this data. With bleachbit however you can easily check the data you want to remove and the program does the rest.

You can run it either as normal user or as root, to be sure you really remove every unnecessary file on your harddisk. It is available in the standart Ubuntu repositories.