FAQforge provides answers for frequently asked questions for the Linux-, MAC and Windows operating systems.

Add Defragment Command to Drives’ Context Menu

Friday, October 21, 2011 - posted by CSch

Since it takes a relatively long time to browse the Windows Control Panel to find the items you are in need of, here is a workaround for one of the items you probably use or should use most, the defragmentation of drives. This guide describes how you use the Windows Registry to add the defragment-command right into the drives' context menu appearing on right-click.
To do so, open the registry by entering regedit into a Run... prompt. What appears is a window parted into two frames, a large arrangement of directories (keys) on the left and their contents on the right. Browse the following key in the left frame:
HKEY_CLASSES_ROOT\Drive\shell
Now right-click the shell key, select New > Key and name it runas. Runas (run as...) defines a new entry in the context menu which lets you open a file, in our case a drive, with a certain application. Look at the contents of runas and double-click the (Default)-value. Change it to the name you want to be displayed in the menu, e.g. Defragment Drive.

Now right-click the created runas-key and create another key inside of that, call it Command. The value inside of that key determines which action should be run upon using the option.

Now you basically could enter any command you can enter in a Windows command line. For defragmentation, the command is defrag followed by the drive and a number of possible switches. To look up which switches are possible, enter defrag -? into a command line. The switch characters are then added to the command lead by a hyphen, as the question-mark before. I think defrag %1 -Uv is basically a good option, so I change the (Default)-value to defrag %1 -Uv. After that, close the registry and right-click a drive and use your newly created defragment-command:

Set a custom boot message on Windows 7

Thursday, October 20, 2011 - posted by CSch

On Windows 7 there is an option that displays a text message to the user of the computer on system start-up. This message is configurable in the Local Security Policy which you can access over the start menu's program search bar. Once in there, expand Local Policies on the left frame of the window and select Security Options. There, find the two entries named message title for users attempting to log on and message text for users attempting to log on.

As the names say, the value of the title message is later displayed as the title, same goes for the text. The text can hold an infinite amount of lines and approximately 94 characters in one line. Close the window after you have specified your desired entries.

Both of these settings are also available in the Windows Registry. To find them, open the registry by typing regedit into the Run... prompt and browse the HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\Current Version\Policies\System key. There, the legalnoticecaption and the legalnoticetext values are stored. These are the registry storages for the values you entered in the Local Security Policy window.

Unpack Compressed Files with WinRar

Thursday, October 20, 2011 - posted by CSch

While working with your computer you surely have come across files in the .zip or .rar format. These are so called packed or compressed files, their function is to store multiple files and/or folders into one single file and compress them so they are easier to send and waste less space. Windows has a built-in function to pack and unpack files: to compress files, just right-click them and select Send to > Compressed (zipped) folder. To uncompress, right-click the zipped file, select Extract all... and choose a directory where to put the uncompressed folder. However there is a more powerful tool called WinRar which is easy to handle, has a bunch of useful functions and also supports another compressing format, .rar which is safer than zipped compression if provided with a password. WinRar is downloadable for free as a 30-day trial version and reminds you to buy the full version after 30 days but is still usable then. You can download the appropriate version for your system here:
http://www.win-rar.com/download.html

Double-click the downloaded file and click Install on the appearing window. The next window displays WinRar's configuration. The checkbox-filled panel on the left determines which formats your computer is supposed to open with WinRar. Usually all predefined settings should be alright, so click on OK.

On the next screen, click on Done to finish installation. Nearly all compressed files are now being associated with WinRar and have adopted its icon:

Uncompress files associated with WinRar by double-clicking them and drag-and-dropping its content anywhere on the screen or clicking on Extract To and choosing the target directory.

To compress files, just select the ones you want, right-click them and choose to either compress them to a .rar archive immediately or to add them to another archive (.zip or whatever you want) with more detailed options.

Disable “Send to” Option on Windows

Wednesday, October 19, 2011 - posted by CSch

When you right-click any object on a Windows system, there is the option Send to which is able to literally send objects to other computers by automatically opening a new mail and attaching the chosen file as attachment, process them with other programs selectable from a list, or just moving the file to a different location (hold the Shift key when right-clicking to enable more options to Send to). The common user however does not use this function really often, in fact, he may also find it annoying since it might cause short freezes on slower computers if one accidently hovers the mouse over it and thus makes it load a list of applications. But as for every other problem on your computer there is also a solution for this one, disabling the Send to command with the registry.
To do that, open your registry by entering regedit in to a Run... prompt and direct it to the HKEY_CLASSES_ROOT\AllFilesystemObjects\shellex\ContextMenuHandlers\Send To key.

Now the default value that is found in that key is

{7BA4C740-9E81-11CF-99D3-00AA004AE837}

If you ever want to revert your setting the easiest way is to just save this value somewhere safe, since the thing you need to do to disable the Send to command is to double-click the value and remove the string so that it is empty. Leave the registry afterwards and the command should no longer appear on right-clicking.

More Options on Right-click (Windows 7)

Wednesday, October 19, 2011 - posted by CSch

There is a feature in Windows 7 that allows access on more options on right-click with any file, just by holding the Shift key while clicking.

The shift option alters the menus of nearly every file to open. For example, it adds the Run as different user and Copy as path options to executables, the Open in new process, Open command window here and Copy as path options to folders and many different new options such as the libraries to the Send to option.

Find malicious system entries with HiJackThis for Windows

Wednesday, October 19, 2011 - posted by CSch

HiJackThis is a software that is able to detect unusual entries on your registry and hard drive and create a log file with the information it gathered about the running processes. This log file can either be analysed by the user himself or be copied into an automatic analyser that shows if the entries are rated safe or dangerous.

You can download HiJackThis here: http://www.trendmicro.com/ftp/products/hijackthis/HiJackThis.msi

If you made the program create a log file after scanning, it is recommended to copy and paste it into an automatic analyser such as the one you can find here: http://www.hijackthis.de/en. The analyser will then give you an overview of the scanned files combined with a rating given by visitors.

If you find any unsafe entries, you are given the option to fix them in the program's window. Be cautious what you delete however, inform yourself about the stated entries and do not rely on information provided by a single source. Always double-check before you delete an entry.

I've got the following error message on Debian Linux (6.0) with Courier IMAP server:

Filesystem notification initialization error -- contact your mail
administrator (check for configuration errors with the FAM/Gamin library)

when I tried to access a IMAP share. The resaon for the problem seems to be that the "fam" package was not working correctly. The solution is to install the gamin package which can replace fam in a courier setup:

apt-get install gamin

Dont worry when you get a message from apt that libfam0 gets uninstalled but is required by courier. This had no geative effects on my server.

Get the name of the newest file in a directory on the linux shell

Friday, October 14, 2011 - posted by Till

If you have a directory with many files (a few thousand in my case) and need to know which one is the newest, then the following command might be useful. It returns the name and details of the newest file in a directory where it is executed:

ls -tl | sed -n 2p

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.