Jameser's Tech Tips

Monday, March 19, 2007

Tip #43: Fixing Corrupted Windows Media Player in Vista

If you are receiving "The specified protocol is not supported" errors in Windows Vista, the following fix should resolve this issue and get WMP11 running again without requiring a reinstall.

1. Close Windows Media Player 11 if it is open...

2. Click on the Start icon, and then click on Computer. In the "Address Bar" at the top of the screen, enter the following:
C:\Users\YOURUSERNAME\AppData\Local\Microsoft\Windows Media



3. You should see a folder named 11.0 Rename this folder to 11.0.bak

4. Restart Windows Media Player and your problematic streams should now be functional again.

Please leave a comment if you have any questions.

Thanks... James...

Wednesday, September 27, 2006

Tip #42: Tracking System Changes of an Application Install

Today's tip is on monitoring the changes made to your Windows system during the installation of an application. We'll be using a utility called InCtrl5, which was developed by PC Magazine. This utility will allow us to track all filesystem and registry changes associated with an application's installation. Knowing this information can prove helpful if you have an application which will not uninstall correctly, or if you suspect that the install package may be installing spyware or other unwanted programs.

InCtrl5 can be downloaded from here or here.

After you have downloaded and installed InCtrl5, you're now ready to monitor an application's install process. To get started, launch InCtrl5 and you should see a screen similar to the one below.


I'll be using the VideoLan Client (VLC) installer as an example. Select the install program you'll be tracking in the top text field. You may also want to change the path and filename of the resulting report if you don't wish to use the default. After you've made your selections, go ahead and click on the GO! button to begin the installation and analysis. Proceed through the program's install as normal.


After the install has completed, click on the Install Complete button to generate the report.


The resulting report should now contain any registry additions, deletions, or changes, as well as any filesystem changes.

Please leave a comment if you have any questions.

Thursday, September 07, 2006

Tip #41: Obtain Whois Information from the Windows Command Prompt

Today's tip is on obtaining domain registration data from the Windows Command Prompt. The whois command is a standard fixture in the Linux/Unix world, but Windows users typically need to resort to web based applications to query Whois information. We'll be taking a look at a small utility called WhoisCL, which will allow you to query whois servers from the Command Prompt as well as from within batch files.

WhoisCL, an application developed by Nir Sofer, can be downloaded from here. Once you have downloaded the application, unzip the WhoisCL.exe file and place it in your path (i.e. C:\Windows). After you have extracted the file, you may want to rename it to whois.exe to make the command easier to remember, especially if you find yourself working on Linux machines frequently.

One nice feature of WhoisCL is the -r switch, which will remove the registrar's cruft from the results you receive.


If you have questions, please leave a comment.

Thursday, August 31, 2006

Tip #40: Portable SSL Enabled Web Server for Windows

Today's tip is on setting up a personal SSL enabled web server for Windows. The application and its configuration files can easily fit on a USB flash drive for portable use. This method is not intended to be used as a large-scale web server, but rather as a simple way to transfer files to a limited group of people.

The application we'll be using is called SHTTPD (Simple HTTPD). SHTTPD provides the ability to use SSL connections, run Perl, PHP, or Python scripts, as well use basic authentication. We'll go over configuring the server for authentication, as well as creating our own self-signed SSL certificate for our SSL connection.

SHTTPD can be downloaded from here.

After you have downloaded the Win32 version of SHTTPD, unzip its contents to a directory on your PC, or to a USB flash drive.

To create our SSL certificate, we'll be using a Windows port of OpenSSL, which can be downloaded from here. Download and extract the OpenSSL files to a directory on your machine, and then download this sample configuration file and place it in the same directory as your OpenSSL files.

Open a Command Prompt (Start/Run/cmd), and change to the directory where you've extracted the OpenSSL files. Use the following commands to generate a self-signed SHTTPD compatible SSL certificate:

openssl req -config openssl.cnf -new -out usbserver.csr

openssl rsa -in privkey.pem -out usbserver.key

openssl x509 -in usbserver.csr -out usbserver.crt -req -signkey usbserver.key -days 730

copy usbserver.key + usbserver.crt usbserver.pem


These four commands will create the file usbserver.pem, which you can now copy into your SHTTPD directory.


Now that we have our SSL certificate created, we can move on to creating a password file for authentication. In your Command Prompt, change directories to where you have SHTTPD installed. Use the following command to create a file called htpasswd which will contain the user ID and password you supply:

shttpd -A htpasswd YourServerName userid password

Replace YourServerName with a name you'd like to call your server, and also replace userid and password with your selections.


Finally, we are ready to start up our web server. To launch the server using our SSL certificate and password file, use the following command:

shttpd -d C:\tmp -s usbserver.pem -N YourServerName -P htpasswd

Replace directories and filenames as necessary to match your needs. The -d switch sets the root directory for your server.


The settings you specified on the command line will be saved to shttpd.conf, so the next time you can start the server by simply launching shttpd.

The SHTTPD server runs in the system tray. To bring it to the foreground, right-click on the smiley-faced icon and select Settings. To exit, select Exit SHTTPD.


Your server can now be accessed by going to https://localhost, or https://your.ip.addr.ess If your machine is behind a router, you'll need to set up port forwarding on your router to point to the IP address of your PC and port 443.

If you have any questions, please leave a comment.

Tuesday, August 22, 2006

Tip #39: Backing Up to DVD Using Free Tools in Windows XP

Today's tip is on backing up a directory or drive to recordable DVD media using free tools. The approach we'll be using will also allow you to span multiple DVDs for larger backup jobs.

The first tool we'll be using is DAR (DiskArchive), which was originally developed as a Linux command line application, but has also been ported to the Windows environment. DAR allows you to create archives of directory structures, while splitting the archive file into multiple files of a user defined size.

The second tool we'll be using is called CommandBurner. CommandBurner is a Win32 utility that can burn files or directories from the Windows Command Prompt.

DAR can be downloaded from here, and CommandBurner can be downloaded from here.

DAR allows you to execute an external application after the creation of each slice of an archive. We'll be taking advantage of this feature, by calling upon CommandBurner to burn each newly created slice.

After you have downloaded and installed both DAR and CommandBurner, you can back up specific directories using the following syntax:
(this should all be entered on a single line)

c:\path_to_dar\dar -c "/cygdrive/T/ArchiveName" -s 4000M -p -b -v -R "/cygdrive/c/DirToBackup" -E "/cygdrive/c/Progra~1/Comman~1/CmdBurn.exe burn /f T:\\%b.%n.%e /l %b.%n /hide /eject; rm -f T:\\%b.%n.%e"

In the above example, you'll need to change the T in "/cygdrive/T/ArchiveName", "T:\\%b.%n.%e" ,and "rm -f T:\\..." to a drive letter where you have space for creating a temporary 4GB file. Also, change "/cygdrive/c/DirToBackup" to the drive and directory you'd like to backup. Notice that DAR requires cygwin style paths, while CmdBurn uses the conventional Windows format.

This single command will create 4GB slices of the directory you specify and then directly burn to DVD, opening the tray for new media after each is burnt. Each DVD will be labeled with the ArchiveName and the number of the backup set, (i.e. ArchiveName.1). The file on the disc will be named the same, but also have the .dar extension.


To view the files contained within your backup set, use the following command:

dar -l /cygdrive/x/ArchiveName

Replace the x above with the drive letter of your DVD drive. If the archive is part of a multidisc set, you'll be prompted for additional discs.

To restore all of the files from the archive, use the command below:

dar -x /cygdrive/x/ArchiveName -R /cygdrive/c/DirToRestoreTo

Replace the x with your DVD drive, and also alter where you'd like to have the files restored to.

For additional information on the many features DAR has available, including compression and encryption, you can consult the documentation available at the DAR site.

If you have any questions on today's tip, please leave a comment.

Monday, August 14, 2006

Tip #38: Capturing Audio To MP3 in Windows XP

Today's tip is on capturing audio in Windows XP as an MP3 file. We'll be using a small utility which provides easy usage from within batch files or in scheduled tasks, as well as when used directly.

The free utility we'll use for capturing audio is called SoundCapture, and is available from here. This utility requires the lame_enc.dll, which can be downloaded from here and then placed in the same directory as SoundCapture.exe.

To use SoundCapture, you'll need to first determine the sound card input you'd like to record from. These differ based on your sound card manufacturer, however typing SoundCapture /? from a Command Prompt will render a list of the inputs available to you. The bitrate, sample rate, title, and duration of the recording can all also be adjusted to your needs using the /br, /sr, /title, and /m /length parameters respectively. The final parameter passed is the name you'd like to call the resulting file.


Once you have determined the input to use, and decided on any optional parameters , you can start the recording using a command similar to this:

SoundCapture /in "Stereo Mix" /br 128 /title "Test Rec" /m /length 30 test.mp3


If your sound card has Stereo Mix as an input choice, you should be able to record anything which is playing through your PC's speakers.

If you have any questions, please leave a comment.

Sunday, August 13, 2006

Tip #37: Creating NTFS Hard Links in Windows XP

Today's tip is on creating hard links on Windows XP systems using the NTFS filesystem. Hard links allow you to create an alternate name for an existing file on the same partition.

The hard link itself is simply a reference to an existing file, and points the exact disk location of the original file without actually duplicating the file. The hard link you create can be in a different directory as the original file, or in the same directory using an alternate name, but it must reside on the same partition as the source file.

To create hard links in Windows XP, use the following command from a Command Prompt (Start/Run/cmd):

fsutil hardlink create new_link_name source_file

One of the benefits of creating hard links is that all hard links to a file, as well as the original file, need to be deleted in order to actually delete the original file from the filesystem. So, if you create a hard link to important.doc called hl_important.doc and the original file is deleted, it will still be available by accessing hl_important.doc. If you delete both, then the file will be removed from the filesystem. Keep in mind though that changes to either the original file or its hard links will affect each other. So, if you overwrite important.doc on accident, your hard links will also contain the same overwritten data.

Another obvious benefit is that you can create an easier to type "alias" for a deeply nested but often accessed file. To create a link to C:\Deeply\Nested\File.doc on the root of your C drive, simply use:

fsutil hardlink create "C:\newlink.doc" "C:\Deeply\Nested\File.doc"


If you have any questions on today's tip, please leave comment.