Posts Tagged ‘Windows’

Windows Powershell Script to Sort Music From Folder to Library

Thursday, February 2, 2012 posted by CSch

The aim of the following script was to take music from a single folder with unsorted but tagged audio files and sort them into the music library according to artist and album. It often happens that you have audio files in your browser’s download folder or your instant messenger’s received files folder where they usually don’t belong. The script should be able to move them into your music library and put them into correct folders named after the artist and the album they’re on.

 

$controlssource = 1
$controlsdest = 1

$objshell = New-Object -ComObject Shell.Application
[void] [System.Reflection.Assembly]::LoadWithPartialName(“System.Drawing”)
[void] [System.Reflection.Assembly]::LoadWithPartialName(“System.Windows.Forms”)

$objform = New-Object System.Windows.Forms.Form
$objform.Text = “Move Audio Data”
$objform.Size = New-Object System.Drawing.Size(300,260)
$objform.StartPosition = “CenterScreen”

$objform.KeyPreview = $True
$objform.Add_KeyDown({if ($_.KeyCode -eq “Escape”)
{$objform.Close()}})

$movebutton = New-Object System.Windows.Forms.Button
$movebutton.Location = New-Object System.Drawing.Size(20,170)
$movebutton.Size = New-Object System.Drawing.Size(75,23)
$movebutton.Text = “Move”
$movebutton.Add_Click({$x=”move”;$objform.Close()})
$objform.Controls.Add($movebutton)

$copybutton = New-Object System.Windows.Forms.Button
$copybutton.Location = New-Object System.Drawing.Size(100,170)
$copybutton.Size = New-Object System.Drawing.Size(75,23)
$copybutton.Text = “Copy”
$copybutton.Add_Click({$x=”copy”;$objform.Close()})
$objform.Controls.Add($copybutton)

$cancelbutton = New-Object System.Windows.Forms.Button
$cancelbutton.Location = New-Object System.Drawing.Size(180,170)
$cancelbutton.Size = New-Object System.Drawing.Size(75,23)
$cancelbutton.Text = “Cancel”
$cancelbutton.Add_Click({$a=0;$x=”nil”;$objform.Close()})
$objform.Controls.Add($cancelbutton)

$objlabel = New-Object System.Windows.Forms.Label
$objlabel.Location = New-Object System.Drawing.Size(10,110)
$objlabel.Size = New-Object System.Drawing.Size(280,40)
$objlabel.Text = “Please specify whether you want to copy or to move your files. Moving the files will remove them from their original directory.”
$objform.Controls.Add($objlabel)

if ($controlssource -eq 1){
$objlabel2 = New-Object System.Windows.Forms.Label
$objlabel2.Location = New-Object System.Drawing.Size(10,10)
$objlabel2.Size = New-Object System.Drawing.Size(280,15)
$objlabel2.Text = “Path to file origin:”
$objform.Controls.Add($objlabel2)}

if ($controlssource -eq 1){
$objtextbox = New-Object System.Windows.Forms.TextBox
$objtextbox.Location = New-Object System.Drawing.Size(10,25)
$objtextbox.Size = New-Object System.Drawing.Size(230,20)
$objform.Controls.Add($objtextbox)}

if ($controlsdest -eq 1){
$objlabel3 = New-Object System.Windows.Forms.Label
$objlabel3.Location = New-Object System.Drawing.Size(10,50)
$objlabel3.Size = New-Object System.Drawing.Size(280,15)
$objlabel3.Text = “Path to music library:”
$objform.Controls.Add($objlabel3)}

if ($controlsdest -eq 1){
$objtextbox2 = New-Object System.Windows.Forms.TextBox
$objtextbox2.Location = New-Object System.Drawing.Size(10,65)
$objtextbox2.Size = New-Object System.Drawing.Size(230,20)
$objform.Controls.Add($objtextbox2)}

if ($controlssource -eq 1){
$browsebutton1 = New-Object System.Windows.Forms.Button
$browsebutton1.Location = New-Object System.Drawing.Size(250,24)
$browsebutton1.Size = New-Object System.Drawing.Size(26,22)
$browsebutton1.Text = “…”
$browsebutton1.Add_Click({$fold1 = $objshell.BrowseForFolder(0, “Select Folder”, 0, “”);$objtextbox.Text = $fold1.self.path})
$objform.Controls.Add($browsebutton1)}

if ($controlsdest -eq 1){
$browsebutton2 = New-Object System.Windows.Forms.Button
$browsebutton2.Location = New-Object System.Drawing.Size(250,64)
$browsebutton2.Size = New-Object System.Drawing.Size(26,22)
$browsebutton2.Text = “…”
$browsebutton2.Add_Click({$fold2 = $objshell.BrowseForFolder(0, “Select Folder”, 0, “”);$objtextbox2.Text = $fold2.self.path})
$objform.Controls.Add($browsebutton2)}

$objform.Controls.Add($copybutton)

#$objform.topmost = $True

$objform.Add_Shown({$objform.Activate()})
[void] $objform.ShowDialog()

$sFolder = $objtextbox.Text
$mFolder = $objtextbox2.Text
#$sFolder = “C:\Users\Public\Music\Sample Music”
#$mFolder = “C:\Users\howtoforge\Music”
$objfolder = $objshell.namespace($sFolder)

if ($X -eq “nil”) {exit}

foreach ($strfilename in $objfolder.items())
{
for ($a ; $a -le 266; $a++)
{
if ($objfolder.getDetailsOf($objfolder.items, $a) -eq “Contributing artists”)
#if ($objfolder.getDetailsOf($objfolder.items, $a) -eq “Albuminterpret”)
{
$artist = $objfolder.getDetailsOf($strfilename, $a)
}
if($objfolder.getDetailsOf($objfolder.items, $a) -eq “Album“)
{
$album = $objfolder.getDetailsOf($strfilename, $a)
}
}
if ($artist -and $album)
{
if (!(test-path($mFolder + “\” + $artist + “\” + $album + $strfilename)))
{
new-item($mFolder + “\” + $artist + “\” + $album) -itemtype directory
if($x -eq “copy”)
{
copy-item $strfilename.Path ($mFolder + “\” + $artist + “\” + $album)
}
if($x -eq “move”)
{
move-item $strfilename.Path ($mFolder + “\” + $artist + “\” + $album)
}
}
}
clear-variable artist
clear-variable album
$a=0
}

The script runs for every audio file in the specified folder that possesses both given details, here they are Contributing artists and Album (you can change it to look for different details but this does not always make sense since the script later creates the folders in the library depending on those data – there are different artist details however which can be chosen from, since not every audio file has all of them (album artist, contributing artists…). To change them, just change the single instance of them in the script. Adjust their names to the display language of your system!).

If the files have both details specified, the script goes to your library and, if not already present, creates a folder with the artist’s title, a folder with the album title inside of that, and copies or moves the file to that location.

If you have fixed folders that you don’t want to browse anew everytime you run the script, comment out the top two lines and the two bold lines, uncomment the two lines underneath the latter. Change the path given there to the path of your folders. You can also just uncomment one of them, just make sure to comment out the right lines when you uncomment one.

To run the script, copy and paste it into a notepad and save it as .ps1 file (select All Files from the type dropdown menu). Then right-click the file and run it with windows powershell. If it is not working, you might have to change your execution policy if you have not already done so. To accomplish that, search for powershell in the Windows menu search bar and right-click to run it as administrator. Enter

set-executionpolicy remotesigned

and run the script again. The script works finde on my Windows 7 Enterprise 64bit machine with PowerShell 1.0 installed, if some one has improvements to make I’d be glad to read.

I’ve experienced that Thunderbird has gotten slower and slower on my Laptop, at last it was nearly unusable. Sometimes I could see the chars appearing slowly on the screen while I typed the email or it was impossible to drag & drop a email to a different folder because Thunderbird was stalled for 10-15 seconds. No other applications on my System were slow and the notebook has afast harddisk and SSD, so this was not the problem. The following steps helped me to speedup Thunderbird so that it got usable again.

Set some interface options

Edit Thunderbird options under Preferences → Advanced → General tab, click on “Advanced options” button and set these values:

layers.acceleration.disabled = true

and

gfx.direct2d.disabled = false

and restart Thunderbird. If it is still slow, try the next options:

Disable AeroGlass

Disabling the AeroGlass interface makes the interface reacting much faster. Install the “NoGlass” Addon which is available in the Thunderbird addon repository.

Disable Folder Indexing

If you have folders with many emails inside, Indexing can slow down Thunderbird. Go To Preferences → Advanced → General tab and disable the Global search.

Antivirus scanning of the Email folders in the filesystem

A antivirus scanner can slow down Thunderbird as well. Configure your antivirus program to exclude the Thunderbird Mail folders from being scanned. Warning: this option should only be used when the email is scanned by a smtp proxy of the antivirus program for viruses before it is handed to Thunderbird.

Cleanup Thunderbird index files

Thunderbird creates a lot of index files. A cleanup of these files can speedup Thunderbird as well, especially if some of them are broken. There is a handy toll called ThunderFix to do that.

Error: 0xc1420117

The directory could not be completely unmounted. This is usually due to applications that still have files opened within the mount directory. Close these files and unmount again to complete the unmount process.

This error happens when you use another Dism.exe which is located in C:\Windows\System32. The correct application to use is C:\Program Files\Windows AIK\Tools\amd64\Servicing\Dism.exe, so you need to direct your command line tool to that location before you run the unmount-command (use cd C:\Path to change directory). Replace amd64 in the path with your architecture or leave it out to go in the Servicing folder inside Tools.

Slipstream Service Packs Into Windows XP Installation Disk

Friday, January 6, 2012 posted by CSch

To slipstream (=integrate) MS Windows Service Packs into an existing Windows XP Installation Disk you need an installation Disk, a working copy of Windows, the downloaded Service Pack, a burning software capable of burning bootable images (for example ImgBurn, which is also free), a DVD burner and an empty disk.
First copy all files of the installation disk into a folder on your hard disk (don’t forget any hidden files) and download the Service Packs you need. Then open a command line by typing cmd into a Run… prompt and direct it to the directory the Service Pack you want to integrate is in with the cd (change directory) command, for example like this:

cd C:\Service_Packs

Don’t forget to double-quote the path if there are any Space characters in it. Next, enter the file name of the Service Pack followed by the integrate switch and the path of the installation disk files in the following syntax:

WINDOWSXP-KB936929-SP3-X86-DEU.EXE /integrate:C:\Windows_XP_Install

Windows_XP_Install is the folder where I copied the files of the disk into and is located directly on the <em>C:</em> drive. After the process is done, create an image from the altered installation files and burn it as bootable CD/DVD.

Free Alternative Burning Software for Windows

Thursday, January 5, 2012 posted by CSch

Nero Burning Rom may be the most used burning software for Windows but despite its high functionality it still is quite expensive. Luckily there are some free alternative burning softwares on the internet which can compete to Nero’s performance, one of them being ImgBurn:

ImgBurn provides you with the crucial burning-processes you will need: writing files, data, and images to a disk. You can copy disks by making images of them or create those from files, making it possible to duplicate your Windows installation disk by copying its files and creating a bootable disk out of it.

Download ImgBurn from its homepage: http://www.imgburn.com/index.php?act=download

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.

Free Windows Malware Removal Tools

Friday, December 23, 2011 posted by CSch

The tools shown here are tools to be used together with a fully functioning anti-virus software and are not meant to replace it. They provide an additional source of security and work by scanning your system for malicious software and other potentially harmful stuff. The three tools I tested were Malwarebytes’ Anti-Malware, SUPERAntiSpyware Free Edition (+ Portable Edition) and Spybot Search & Destroy (+ Portable Edition). They all ran on the same system with the same prerequisites. Although, or rather because all their results in scanning differ, it is recommendable to have all of them installed and let them scan your system from time to time.

Malwarebytes’ Anti-Malware

Of the three softwares tested, this is the only one that found two trojans on the system. It offers a quick scan and a complete scan option where the quick scan took about 3 minutes and a complete scan took about 45 on 25 GB of data. It removed all found items accurately but unfortunately has no official portable version.
Download Malwarebytes’ Anti-Malware here: http://www.malwarebytes.org/

SUPERAntiSpyware Free Edition

Of the two trojans that were found by Malwarebytes’ Anti-Malware, SUPERAntiSpyware found one but it also found quite a few adware-tracking cookies which you also might want to get rid of, although they usually are no dangerous objects. Like Malwarebytes, it offers a quick and a complete scan option, which, too, take about 3 and 45 minutes on 25 GB data. Additionally, SUPERAntiSpyware comes with many useful tools that might come handy if you have got a virus disabling critical system functions as re-enabling your task-manager or the system restore service and many more.
There is also a portable version of the software that works perfectly alright and comes with the same functions as the installable free version.
Download all versions here: http://www.superantispyware.com/

Spybot Search and Destroy

In the current test, unfortunately Spybot found none of the items that the others did, although it has proven worthy in previous ones. Spybot offers one scan option which takes about 20 minutes on 25 GB data. It comes with an extra feature called Immunize, which blocks certain malicious websites if activated. Furthermore, Spybot gives you the option to install TeaTimer, a process running in the background that detects malware that tries to make changes in your registry.
Like SUPERAntiSpyware, Spybot offers a portable version which works well from any USB device.
Download Spybot here: http://www.safer-networking.org/en/download/index.html

Mac OS X-like Dock for Windows 7

Wednesday, December 21, 2011 posted by CSch

The Dock, main navigation element in Apple’s Mac OS X, is a powerful tool to quickly access your most important files if you tend to use the same pieces of software or the same folders over and over again. Rocketdock is such a dock application designed for Windows:

It works like the original OS X dock and can be placed on every border of the screen, additionally being highly customizable in terms of theme, effects and behaviour:

You can download Rocketdock here: http://www.rocketdock.com

Windows XP Zune Theme

Tuesday, December 20, 2011 posted by CSch

Additionally to the default Windows XP themes, Microsoft has released a darker skin fitting the Zune player. It basically uses the same textures as the glassy skin but comes mainly in black with an orange Start button:

Download the Zune theme here: http://go.microsoft.com/fwlink/?LinkID=75078

Disabling Aero on Windows 7

Thursday, December 15, 2011 posted by CSch

The Windows 7 Aero desktop theme can cost you quite a lot of performance, which is why you might consider disabling it. To do so, open the Control Panel and select Appearance and Personalization:

Next go to Change the theme and scroll down to Windows Classic: