TomGee.us

7-Zip Command Lines (Windows)

by Tom Gee on Aug.09, 2010, under Scripts

To extract all .zip files in the specified directory and make a new folder in the current directory for the extract that has the same name as the .zip file:

  • D:\Unzipped>”c:\Program Files\7-Zip\7z.exe” x d:\Zips\*.zip -o*
Archive a folder
  • “C:\Program Files\7-Zip\7z” a -tzip D:\Zips\Data_20100801.zip D:\Output\Data_20100801
Leave a Comment :, , , , , , , , , , , more...

Backup PC via Batch Script

by Tom Gee on Apr.25, 2010, under Scripts

I made a few small alterations to the script found [http://www.speedguide.net/read_articles.php?id=1547] and use it on a regular basis to backup my Windows 7 PC.

The source code is as follows, where F:\Backup is the location on my external drive where I want my files to be copied to:

@echo off
:: variables
set drive=F:\Backup
set backupcmd=xcopy /s /c /d /e /h /i /r /y
echo Starting Backup – %date% %time% >> %drive%\backup.log
echo ### Backing up Documents…
echo   Documents >> %drive%\backup.log
%backupcmd% “%USERPROFILE%\Documents” “%drive%\Documents”
echo ### Backing up Pictures…
echo   Pictures >> %drive%\backup.log
%backupcmd% “%USERPROFILE%\Pictures” “%drive%\Pictures”
echo ### Backing up Desktop…
echo   Desktop >> %drive%\backup.log
%backupcmd% “%USERPROFILE%\Desktop” “%drive%\Desktop”
echo ### Backing up Downloads…
echo   Downloads >> %drive%\backup.log
%backupcmd% “%USERPROFILE%\Pictures” “%drive%\Downloads”
echo ### Backing up Favorites…
echo   Favorites >> %drive%\backup.log
%backupcmd% “%USERPROFILE%\Favorites” “%drive%\Favorites”
echo ### Backing up Music…
echo   Music >> %drive%\backup.log
%backupcmd% “%USERPROFILE%\Music” “%drive%\Music”
echo ### Backing up Videos…
echo   Videos >> %drive%\backup.log
%backupcmd% “%USERPROFILE%\Videos” “%drive%\Videos”
echo Backup Complete!
echo Backup Complete – %date% %time% >> %drive%\backup.log
Click [this link] to download the above batch script and enjoy!

1 Comment :, , , , more...

reader_s.exe Virus Removal Instructions

by Tom Gee on Apr.25, 2010, under Operating System

A couple of my clients came to me because their computer seemed to be infected with a virus.  I hear this often and never know what exactly I’m getting myself into when I arrive to fix the issue.  Recently, “reader_s.exe” has been the pain that I have been encountering, but I think that I have finally figured out how to completely rid the infected machine of the lil bugger.

Symptoms:

  1. Internet not working
  2. Constant pop-ups (scareware) indicating that the machine was “infected” and prompting the user to pay a certain amount of money to purchase and download their “antivirus” software, which was actually a bogus program that simply removed the pop-ups that they, themselves, created.
  3. USB drives not working

Resolution:

  1. Booted the computer into Safe Mode by pressing the F8 key on the keyboard when the computer is booting up and the Windows XP logo screen appears.  Select Safe Mode from the boot menu and hit Enter.
  2. Once in Safe Mode, delete the Reader_s.exe files from the C:\Windows\System32 and C:\Documents and Settings\YourUserName directories
  3. Most essential Windows Services had also been disabled, so I used a “clean” XP machine as master list of what needed to be re-enabled.  To re-enable the services:
    1. Click on your Start menu and then click on Run.
    2. In the Run box type “services.msc” and press OK.
    3. When the Services list appears, open (by double-clicking) each of the below services (if currently “disabled”) and changing their Startup type to “Automatic” and press OK to save the changes.
      1. Automatic Updates
      2. Computer Browser
      3. Cryptographic Services
      4. DCOM Server Process Launcher
      5. DHCP Client
      6. Distributed Link Tracking Client
      7. DNS Client
      8. Error Reporting Service
      9. Event Log
      10. Help and Support
      11. IPSEC Services
      12. Logical Disk Manager
      13. Plug and Play
      14. Print Spooler
      15. Protected Storage
      16. Remote Procedure Call (RPC)
      17. Remote Registry
      18. Secondary Logon
      19. Security Accounts Manager
      20. Security Center
      21. Server
      22. Shell Hardware Detection
      23. System Event Notification
      24. System Restore Service
      25. Task Scheduler
      26. TCP/IP NetBIOS Helper
      27. Themes
      28. WebClient
      29. Windows Audio
      30. Windows Firewall/Internet Connection Sharing (ICS)
      31. Windows Management Instrumentation
      32. Windows Time
      33. Wireless Zero Configuration
  4. Once all of the above Services have have been re-enabled and the “reader_s.exe” files deleted, reboot the computer.
  5. You should notice that your machine booted into Windows faster and that you can now plug USB devices and drives into your computer and have them recognized by Windows; this is because the Plug and Play Service was previously disabled.
  6. Your network connections probably don’t work still, so on another machine, copy this [ndis.sys] file (copied from my Windows XP SP3 CD) to a thumb drive.
  7. Now, plug the thumb drive into your “infected” PC and copy the ndis.sys file from the thumb drive into the C:\Windows\System32\Drivers folder and overwrite the existing file
  8. Reboot the computer one more time, and the network adapters should all be working!
  9. Have a beer to celebrate that you didn’t lose all of your files!

It’s scary to think that you might lose all of your files because of a scamware/scareware program, so BACKUP YOUR FILES REGULARLY!  I recommend purchasing an external hard drive and either manually copy your important files to the disk, or setup an automatic backup program on your PC to copy the files for you.  Here is a [link] to the backup script that I use personally.

3 Comments :, , , , , , , , , , , , , , , , , , , , , , , , , , more...

Microsoft Excel: Count the number of unique values in list

by Tom Gee on Apr.19, 2010, under Excel

To count the number of unique or distinct values in a list in Microsoft Excel, use the following formula.  A2:A177 is the range of cells you want to count the unique values in:

=SUM(IF(FREQUENCY(A2:A177,A2:A177)>0,1))

Leave a Comment :, , , , , , , more...

Twice baked potatoes on the grill

by Tom Gee on Apr.16, 2010, under Entree, Uncategorized

Start with two 6-7″ Russet (Idaho) potatoes.

Wash potatoes with cold water

Place 2 potatoes on a paper towel on a plate.

Using a fork, stab the top of the potatoes deep enough to simply pierce the skin and allow moisture/steam to escape.

To speed up the cooking process, place plate of potatoes into microwave.

Cook in microwave on High for 15 minutes, flipping the taters over every 5 mins.

After they have been in the micro for 15 mins, remove from microwave and allow to cool 5-10 mins or until they are cool enough to touch.  This is a good time to begin pre-heating your grill.  Heat to medium (400 degrees give or take)

Next, cut the potato length-wise, removing the top 1/3 of the tater.

Now, grab a spoon and gently begin scooping the “meat” out of the potato and place it into a medium size bowl, thus turning the potato into a tater boat.  Try to leave about 1/4″ of the potato against the skin for strength.

Tater boat

Tater boat

In the bowl that you scooped the innards into, add 1/2 cup sour cream, 2/3 cup cheddar cheese, 1 tbsp minced parsley (parsley flakes will work too), a little salt and pepper, and mix around.  Don’t over-mix the filling, leave it chunky.

Tater filling

Scoop the mixture back into the tater boats.  There should be a little too much mixture left over after filling the boats.  Om nom nom…

I like to add bacon pieces on top of my potatoes.  Any salad bacon toppers work fine for this.

Place the potatoes directly on the grill and cook for approximately 10-15 mins.  Try to keep the lid down so that the heat permeates all sides of the taters.

Tater 1

Tater 1

Tater 2 - with bacon pieces

Tater 2 - with bacon pieces

Remove the potatoes once they start to become golden and you can see the cheese mixture starting to bubble out.

Twice baked potatoes, fresh off the grill!

Twice baked potatoes, fresh off the grill!

Twice baked potato with thin-cut NY Strip steak (Montreal steak seasoning), both grilled.

Twice baked potato with thin-cut NY Strip steak (Montreal steak seasoning), both grilled.

Om nom nom!

1 Comment :, , , , , , , , , , more...

Stop the loud system beep on remote desktop sessions

by Tom Gee on Apr.16, 2010, under Remote Desktop

Sick of the ridiculously loud system beep coming from your Remote Desktop sessions, even if you have Remote Audio Playback turned off?  If so, do the following on your local machine that you are connecting from:

  • Open Device Manager
  • View > Show Hidden Devices
  • Expand the Non-Plug and Play Drivers node
  • Right-click Beep and choose Disable

You’ll have to reboot or log-off and back in for the change to take effect.

That’s all there is to it!

Leave a Comment :, , , , , , , , , , , , , , , , more...

Sequentially run all VB Script (.vbs) files in a directory

by Tom Gee on Apr.06, 2010, under C#, Uncategorized

Create a new C# Console Application in Visual Studio and compile the code.  Copy the compiled .exe file to the directory containing the .vbs scripts you want to run in sequence.

using System;
using System.Collections.Generic;
using System.Text;
using System.IO;
using System.Diagnostics;
/*————————————————————————–
* Developer: Tom Gee
* Date: April 6, 2010
* Description: This .exe file will run every .VBS file in the same directory
*              as the .exe, but will wait for the current .VBS script to end
*              before beginning the next.
————————————————————————–*/
namespace RunAllVBSinDirectory
{
class Program
{
static void Main(string[] args)
{
try
{
string[] scripts = Directory.GetFiles(Directory.GetCurrentDirectory(), “*.vbs”);
int i = 0;
foreach (string script in scripts)
{
i++;
Console.WriteLine(“Running: ” + script);
using (Process exeProcess = Process.Start(script))
{
exeProcess.WaitForExit();
exeProcess.Close();
exeProcess.Dispose();
}
}
Console.WriteLine(“Ran all ” + i + ” script files in current directory (” + Directory.GetCurrentDirectory() + “)“);
Console.ReadLine();
}
catch (Exception ex)
{
Console.WriteLine(“ERROR! ” + ex.Message + Environment.NewLine + “Inner Exception: ” + ex.InnerException + Environment.NewLine + “Stack Trace: ” + ex.StackTrace);
Console.ReadLine();
}
}
}
}
Leave a Comment :, , , , , , , , , , , , , , , , more...

How to generate a random number in C#

by Tom Gee on Mar.19, 2010, under C#, Programming

Here’s a quick and dirty way to use Microsoft’s “Random” class for generating a random (or as you will soon find out, not-so-random) number.

Because I believe in code reuse, I started by creating a new function that would return the random number as an integer datatype.

static int RandomNumber(int min, int max)

{

Random random = new Random();

return random.Next(min, max);

}

The only things you have to pass to the function are the upper and lower boundaries that you want the random number to fall between.

int zip = RandomNumber(10000, 99999);

In the above example, a random number between 10000 and 99999 will be assigned to the “zip” variable.

As I stated above, the random number isn’t actually very random and, therefore, might not be a perfect fit for what your trying to use it for.  However, the Random class serves its purpose for quick data generation for application testing.

Happy coding!

Leave a Comment :, , , , , , , more...

Home Fries

by Tom Gee on Feb.28, 2010, under Breakfast

Today was my first attempt at making homemade home fries.  They were very easy to make and very tasty!

  1. Cube 3-4 medium size potatoes
  2. Add to saucepan with 3 tablespoons of butter or margarine.
  3. Bring to medium heat, make sure all of the potato cubes have been coated with the butter, and cover for 10 minutes
  4. Remove cover, add seasoned salt & pepper, and continue cooking on medium for another 5-10 minutes or until golden (stir frequently)

That’s it!  I’ll have to make them again in the near future and snap a pic to add to this post.  Om nom nom!

Leave a Comment :, , , , more...

Print Spooler Error in Windows 7 under Boot Camp

by Tom Gee on Jan.31, 2010, under Boot Camp

BACKGROUND:

A few months ago I installed Windows 7 on my Macbook Pro (13″ Unibody running Snow Leopard).  Yesterday I decided to try and boot into my Win7 Boot Camp partition via VMWare Fusion v2.03.  Doing this installed VMWare tools to Windows 7.

PROBLEM:

Today, when I booted directly into my Windows 7 partition (not via VMWare), I noticed that I couldn’t print anything anymore.

I checked the Event Viewer and found the following error in the System log:

The Print Spooler service terminated unexpectedly.

In the Application section of the Event Viewer, I found the following:

Faulting application name: spoolsv.exe, version: 6.1.7600.16385, time stamp: 0x4a5bd3d1
Faulting module name: TPVMMon.dll, version: 2.0.51.5, time stamp: 0×48359080
Exception code: 0xc0000005
Fault offset: 0x000000000000846e
Faulting process id: 0×1300
Faulting application start time: 0x01caa2aa2c4394d8
Faulting application path: C:\Windows\System32\spoolsv.exe
Faulting module path: C:\Windows\System32\TPVMMon.dll
Report Id: 7188e318-0e9d-11df-9123-895fd79b6e49

Faulting application name: spoolsv.exe, version: 6.1.7600.16385, time stamp: 0x4a5bd3d1Faulting module name: TPVMMon.dll, version: 2.0.51.5, time stamp: 0x48359080Exception code: 0xc0000005Fault offset: 0x000000000000846eFaulting process id: 0x1300Faulting application start time: 0x01caa2aa2c4394d8Faulting application path: C:\Windows\System32\spoolsv.exeFaulting module path: C:\Windows\System32\TPVMMon.dllReport Id: 7188e318-0e9d-11df-9123-895fd79b6e49

The only thing I could attribute the Print Spooler issue to was VMWare Fusion.

I tried uninstalling the VMWare Tools program listed in the Control Panel > Uninstall Program section, but it would not remove.  No errors were displayed, but the program wouldn’t remove from the Programs list.

SOLUTION:

I deleted the following folder (and all related subkeys) from the Registry (via Start > Run > regedit):

[HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Contro l\Print\Monitors\ThinPrint Print Port Monitor for VMWare]

1 Comment :, , , , , , , , , , , , , , , , , more...

Looking for something?

Use the form below to search the site:

Still not finding what you're looking for? Drop a comment on a post or contact us so we can take care of it!