SoftwareDistribution Folder Delete in Windows

Clean Up The SoftwareDistribution Folder in Windows to Free Up Disk Space

A PC running Windows 8.1, Windows 8 or Windows 7 regularly performs a Windows Update. The updates improve security, fix bugs and add or change functionality. The files for the update download to a temporary folder from the Windows update site. Once the files have finished downloading in the background the update can be applied to the PC. The temporary folder is called Download under SoftwareDistribution in the Windows directory (unless in some rare occasions Windows is installed to a different directory), i.e. C:\Windows\SoftwareDistribution\Download. If trying to view this folder in Windows Explorer you may need to give permission and be logged in as an Administrator, as well as turning on Hidden items in the View menu (or via Organise and Folder and search options in Windows 7).

When the system drive runs low on disk space some free space may be reclaimed by deleting the Windows Update temporary downloads folder. Therefore a full SoftwareDistribution folder delete is not done, just the Download folder in that directory. The SoftwareDistribution\Download folder delete may fix problems that stop the Disk Cleanup utility from finishing. (The Disk Cleanup utility can take quite a while to finish and if still not finished after a few hours if may be stuck due to Windows Update conflicts.)

Apply Any Remaining Windows Updates

If the \Windows\SoftwareDistribution\Download folder delete is performed before Windows Update has installed existing download files then those files will download again. To stop this from happening ensure Windows Update has completed. Open Windows Update. In Windows 8 select Settings then Control Menu (or press the Windows key and X and select Control Panel from the menu that appears), enter Update in the search box and select Windows Update. In Windows 7 select Windows Update from All Programs off the Start button (or via Start then Control Panel then System and Security).

Select Check for updates to ensure that “No updates are available“. Otherwise Install Updates. (If low on disk space updates may fail to apply, try emptying the Recycle Bin, Deleting Browsing History in Internet Explorer or running the Disk Cleanup utility.)

Temporarily Stop the Windows Update Service

With all Windows updates applied stop the Windows Update service to safely remove the \Windows\SoftwareDistribution\Download folder. Run Task Manager (press the Ctrl-Alt-Delete keys all at once and select Task Manager or Start Task Manager from the menu). Click the Services tab. Sort the list by name (click the Name column). Browse to the wuauserv entry and check the Status column. If it says Running stop the wuauserv service. To stop the service select Open Services at the bottom of Task Manager (or the Services button in Windows 7 Task Manager).

In Services click on the name column to sort the service alphabetically. Locate Windows Update. Select Stop the Service from the left hand column above description, or double-click on Windows Update to open the properties and click the Stop button, then click OK to close the properties.

Using Windows Explorer rename the Download Folder in \Windows\SoftwareDistribution. E.g. bring up the context menu and slect Rename call it something like Download_old. Windows will create a new Download folder when it needs it, it will be empty until new Windows updates are available and are loaded.

On Windows 7 Restart the Windows Update Service

Windows 8 will start the Windows Update service when it needs it. In Windows 7 select Start Service in Services or double-click on Windows Update and select the Start button, click OK to close the properties.

Delete the Renamed Folder

In Windows Explorer delete the renamed Download folder. For example if it was renamed Download_old then delete Download_old. Permission may need to be given to do this, if so click Continue on the message box that appears.

The Windows Update temporary Download folder, under the SoftwareDistribution folder, delete has been completed.

Clear Web Cache and Moving Browser Cache Folder

How to Clean Up The Web Cache and Move The Cache Folder

Normally you do not even need to think about the browser’s cache. You may not even know what the web cache does. The web cache stores some of the web pages you have visited on the PC, so that when you visit the same site it does not need to get all the data from the Internet again. Thus the web cache uses space on the hard disk.

The web cache automatically clears out old items and adds new items as the user browses. In day-to-day usage the cache operates in the background with the user not needing to worry about it. However, if the disk drive the cache is stored on runs low on space then the cache may need to be cleaned out to free some space. It can also be moved to another disk to help with disk space management. Finally it can be moved to another disk, including RAM disks, if that other disk is faster, to help improve the performance of the system.

Clear Web Cache in Internet Explorer

Access Internet Explore Settings to Clear Web CacheTo clear web cache in IE open the settings and chose Internet options. On the General tab under Browsing history select the Delete button. The default options are normally OK. As a minimum Temporary Internet files and website files must be checked. Select Delete and the web cache will be cleared. A message will appear on IE when the process has finished and you can close the Internet Options dialog. It is also worth running a third party cleaner, such as Piriform’s CCleaner (Computer Cleaner), to clear more cache items that cannot be cleared while IE is open.

Move Browser Cache in Internet Explorer

Close all open programs except for IE. Clear the IE cache as above then select the Settings button. In the Web Data Settings box on the Temporary Internet Files tab select Move folder. Select a new location, preferably on a different drive. For example the folder D:\Temp was created using Windows File Explorer, D:\Temp was then selected from the Move folder button so that the new cache location became D:\Temp\Temporary Internet Files. Click OK and accept the message to confirm the move, the PC may need a restart. Read on to see how to clear and move the cache for Chrome, Firefox and Opera. Continue reading

Text File Edit Component for .NET WinForms Applications

A WinForms .NET Control to Add Text and Source Editing to Windows Applications

Here we show you how to add a lightweight .NET text editor component to a Windows Forms application, the control supports color coding when editing source files (based on the file extension). This component is compatible with version 2.0 of the .NET framework and higher, so it is suitable for use on older versions of Windows, such as Windows XP. The control is called Text File Edit (TFEdit for .NET) and comes as a single DLL (Dynamic Link Library), TextFileEdit.dll. It has several useful properties including turning the display of tabs and spaces on and off, EOL (end-of-line) marker support, showing line numbers and vertical and horizontal rulers. The component is from an Open Source project so all the code is available to change and improve. It comes with a small demonstration project to test it out, here is the component in action in the demo project:

.NET Text Editor

Background

A while back (several years ago) a C# Windows project required a simple text editor to allow users of a program to edit text based files and log files without needing to switch to another application (such as Notepad or Word). The editing capability was a small part of the requirements. At the time the use of the .NET text box did not provide enough functionality, the Rich Text Format control was not suitable, all commercial editors were two complex and added costs to the project. The answer was to extract the text editor portion of a Open Source IDE (Integrated Development Environement) project called SharpDevelop. The SharpDevelop component was called ICSharpCode.TextEditor.dll. This component was refactored to simplify the namespace to TextFileEdit, and a simple test project was written. This was then published on a previous web site where it sat for a few years before the web site was repurposed. With the release of a new version of Visual Studio Express (verison 2012) it was decided to see how well it handled older controls. So the Text File Edit DLL was dusted down and given a go.

Download and Run the Example C# Text Editor

You can download the Text File Edit DLL, source code and a demo test project using the TFEdit.zip file. Extract the contents to a folder on your computer. If you are using Visual Studio Express create a folder, e.g. call it TFEdit, in the Visual Studio Projects directory. Projects is normally in the Visual Studio directory (Visual Studio 2010 or Visual Studio 2012 folders) in My Documents. Open the solution (T_F_E_Solution.sln), the solution was created in Visual Studio 2008 so you will see a conversion report for later editions of Visual Studio. Set the TFETest project as the start-up (select Set as StartUp Project from the context menu). The project should run.

Use the Text File Edit Control in Your Projects

Text File Edit Added to ToolboxThe TextFileEdit.dll is in TextFileEdit\Project\bin\Release. With Visual Studio running start (or open) a Windows Forms Application project. Open the Toolbox (use the View menu if neccessary) and drag and drop the TextFileEdit.dll onto a tab, e.g. the General tab or create a new tab to hold the control. With a WinForm open in design mode drag the TextEditorControl from the Toolbox onto the form. It can then be positioned and properities set.

Text File Edit in Use

The ZIP file that contains the source code has more detailed instructions on adding TFEdit to a project, although it was written sometime ago for Visual Studio 2008.

Text File Edit .NET Control Properties

The TFEdit control supports the following properties:

  • AllowCaretBeyondEOL – When set to “true” the caret (typing cursor) can be moved beyond the end of the actual line. When it goes beyond the last character it is in a screen position and not in any text. Pressing the Return (Enter) key fills the line with spaces up to the point the caret has been moved and creates a new line.
  • BracketMatchingStyle – When set to “After” pairs of brackets, () or [] or {}, are highlighted when the caret moves past them. When set to “Before” the brackets are highlighted as the caret approaches them.
  • ConvertTabsToSpaces – When set to “true and a tab is typed, the tab character is not placed into the text. Instead spaces are placed into the text, the number of spaces being equal to the “TabIndent” property.
  • HideMouseCursor – When set to “true” the mouse cursor his hidden during typing.
  • IndentStyle – When set to “Auto” the text on the next line will start at the same postion as the current text. The same number of tabs and spaces are added to the new line that preceed the current line. When set to “None” no indentation occurs.
  • IsIconBarVisible – Shows a vertical bar on the lef hand side on to which icons can be programmatically placed on a line by line basis.
  • LineViewerStyle – When set to “FullRow” the line that has the focus for typing is highlighted. When set to “None” no highlight is present on the current line.
  • ShowEOLMarkers – When set to “true” a light marker (pilcrow character) is shown to indicate where the end of the line (carriage-return and line-feed character pair) will occur in the text file.
  • ShowHRuler – When set to “true” a “ruler” is drawn at the top of the text, within the control bounds, to give a visual indication of the columns.
  • ShowInvalidLines – When set to “true” the space below the last line will have a marker to show the additional lines that can fit into the area. This markers just indicate the position of additonal lines and are not lines present in the file to be saved.
  • ShowLineNumbers – When set to “true” line numbers appear in a margin at the left of the control within the control boundaries.
  • ShowSpaces – When set to “true” a light dot will indicate a “space” character.
  • ShowTabs – When set to “true” a tab character in the text is indicated by a light right pointing double angle character.
  • ShowVRuler – When set to “true” a vertical line is drawn down the control. It will be positioned at the “text column” indicated by the property “VRulerRow”.The vertical line can be used as a visual guide to determine the length of lines. Sometimes it is necessary to limit the length of lines in a text file for some systems, usually to 80 or 120 characters.
  • TabIndent – This property determines the number of character columns to indent when a tab is pressed or a tab is present in the text.
  • VRulerRow – This property determines the character column in which the vertical ruler line will be displayed.

Issues

When editing source code files the highlighting of paired brackets does not always occur.

Future Releases

There are no plans to release future versions of this control. The source code is available under the LGPL licence for you to make any required changes. The code was taken from an early version of the SharpDevelop IDE. Whilst the text editor in SharpDevelop has changed several times over various SharpDevelop releases TFEdit has not. The current SharpDevelop text editor is a WPF (Windows Presentation Foundation) component called AvalonEdit, it can be loaded into a WPF solution using the Manage NuGet Packages option from the Library Package Manager of the Tools menu, search for AvalonEdit. (To install NuGet select Extensions and Updates from the Tools menu in Visual Studio Express 2012. Select Online in the left hand panel and then NuGet Package Manager, download and install.)

Summary

TFEdit for .NET is a text editor component for WinForms applications. It was used to see if the new 2012 version of Visual Studio Express worked seamlessly with older components. Happily it worked fine for this control. TFEdit is compiled against version 2.0 of the .NET framework so will run on older Windows platforms. In theory it will run across several Operating Systems using Mono but that has not been tried. A compiled DLL, source code and demo program is available in the TFEdit.zip file. It is licensed under LGPL.

Move My Documents and Other Personal Folders in Windows 8.1, 8 and 7

A Tutorial on Moving User My Documents and Personal Folders to Another Drive

Default Folders are Created for Windows UsersEach user on a Windows computer (Windows 8.1, Windows 8 and Windows 7 and earlier) is given a private location on the PC into which they can store their work. This work can be pictures, documents, music, emails, videos and anything else that they use or generate. It is private because other users cannot view their files (unless they are logged in as an Administrator). When a user logs on they can work with their private files and any Public files. To let other users see their work it needs be moved or copied into the relevant Public folders, or a directory needs to be marked as shared.

Root Users FolderThe default installation for Windows is to put all the users folders onto the same hard disk drive as the operating system itself, usually the first, and only, hard disk in the system, called the C: drive. This drive will also hold any additional programs that are installed. Each user is located under the Users folder on C:, so a user call John Doe has folders located at C:\Users\John Doe. Under the users main folder is a folder to store different types of files that programs generate or use. For example there is a Contacts folder (at C:\Users\John Doe\Contacts) to store, well, contacts (name, address, phone numbers, etc.). Use Windows Explorer to view the Users folders. Open Windows Explorer via the Start button, All Programs and Accessories, or in Windows 8.1 hold the Windows key and press E. The various folders created by Windows for the user can be seen under the user’s name from the Desktop icon (Windows 7) or under C:\Users\User Name in Windows 8.1.

Some of the folders are also accessible via the various Library icons. In Windows 7 in Explorer some folders begin with My, such as My Documents or My Music. However, the actual folder name on the hard disk does not have My, thus My Documents in Explorer points to C:\Users\John Doe\Documents. This table shows the folder name, the display name in Explorer and whether or not a public version is available, located at C:\Users\Public (this folder itself can be used to make files public).

User Folders
Folder Win 7 Name in Explorer Public Version
Contacts Contacts  N/A
Desktop Desktop  Public Desktop
Documents My Documents  Public Documents
Downloads Downloads  Public Downloads
Favorites Favorites  N/A
Links Links  N/A
Music My Music  Public Music
Pictures My Pictures  Public Pictures
Saved Games Saved Games  N/A
Searches Searches  N/A
Videos My Videos  Public Videos

Locating all the user folders on the one hard disk drive along with Windows and all the programs makes configuration and manufacture of a new computer easier. Unfortunately it has several disadvantages: Continue reading