Posts Tagged ‘folder’

Using document templates in Linux

Tuesday, June 26, 2012 posted by CSch

The usual thing you find when you right-click your desktop to create a new document is the option to create an empty text document. This selection can be widened however by using the Templates folder in your home folder. Any document that is put in there will be selectable; this is also possible with pictures and other formats. Pinguy OS for example provides and excellent working system out of the box and comes with multiple file templates installed:

The string Untitled is put in front every newly created document from a template. To remove an item from the list, just remove it from your Templates folder. By making a document invisible in the Templates folder it is also removed from the list.

Pin folders to taskbar on Windows 7/8

Friday, March 9, 2012 posted by CSch

By default, if you try pinning folders to the taskbar on Windows 7 or the current version of Windows 8 the folder will be put into the context menu of the taskbar's explorer icon.

To prevent this and stick a folder directly to the taskbar, you need to create a shortcut of the folder you want to pin (right-click and Create shortcut). Afterwards right-click the shortcut and select Properties. On the Target line you will see the path of the object that the shortcut is pointing to - put explorer in front of that path and separate them with a space character (e.g. explorer "C:\New_Folder"). Now click OK and drag the shortcut to the taskbar.

Add Right-Click Menu to Open Any Folder on Windows

Thursday, March 8, 2012 posted by CSch

The context menu you gain by right-clicking the desktop is a powerful tool to open any kind of data and program. If you have a folder that you need to access regularly it might be a clever idea to simply pin it to that right-click menu to shorten the access time.

To achieve that you need to add a few keys to the registry. Open it by typing regedit into a run prompt which you get by hitting Windows key + R. In the registry, navigate to the Computer\HKEY_CLASSES_ROOT\Directory\background\shell key and right-click it to create a new key (New > Key). Give it the name of the command that shall later appear in the menu (Custom Folder in the example above). Afterwards right-click the created key and create another one called command. Left click the command key and change the (Default) value by double-clicking it. It has to be something like

explorer.exe C:\Users\howtoforge\Pictures

Replace the path I used with the one to your folder (embrace it in double-quotes if it contains spaces) and put the explorer.exe in front of it, so the system knows which program to use to open the command.

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.

Reset Folder Options on Windows XP

Thursday, October 13, 2011 posted by CSch

If you have ever tried to set another default application for opening file folders on Windows XP and to turn it back afterwards, you will have run into a really nasty bug.

If you try to restore the default settings of an application to open a folder, the folder will no longer open as before (normal explorer window, further folders open in the same window) but will open a search window on doubleclick.

You cannot achieve the former behaviour by trying to reset it in the control panel. What you have to do is to create a new opening action for File Folder and set it as default. Afterwards, open Run... and enter regedit to open the Windows Registry. On the left side of the registry, there is a list of directories. Browse this list to HKEY_CLASSES_ROOT > Directory > shell and click on the plus-button next to shell to unfold the actions to open file folders with. Now look for the new opening action you have previously created and set as default. Rightclick it, choose Delete and confirm your choice. It is not enough to delete this entry in the Control Panel, it has to be done in the registry. Close the registry after deletion and try out doubleclicking a folder. It should now open like it usually used to.

Encrypt Folders (Ubuntu Linux)

Friday, September 30, 2011 posted by CSch

To encrypt folders on Linux Ubuntu there is a simple program called Cryptkeeper which, while active, lets you mount and dismount password protected folders.

While unmounted, the encrypted folders are invisible to the user. While mounted, you need to enter the password to access its contents. To create a new encrypted folder just click on the key icon on the system panel and select New encrypted folder.

Make sure to unmount the encrypted folders before you quit Cryptkeeper since the files become accessible if they are mounted and Cryptkeeper is inactive. The files remain invisible if they are unmounted and Cryptkeeper is quit.