Friday, September 6, 2013

Automatically Delete Local Shared Objects

Also called "flash cookies," Local Shared Objects" (LSO's) can be used by any web site to store information about your web browsing.  Web developers explain that this capability is used "to enhance your web-browsing experience," but skeptics (like me) know that it can also be used to track a user's browsing in detail and even to share that information with unsavory sites.  LSO's may or may not be cleared when you attempt to clear your browser's cookies.

LSO's may be important to some applications.  Games, for example, may save the current state of the game in LSO's, so that the game can be stopped and then resumed.  However, in my computer usage I do not know of any such beneficial application of LSO's and I prefer to delete them.

Third parties have created extensions for some of the browsers which will delete LSO's automatically.  However, this script will also do it, without installing an extension:

    TITLE "Delete Local Shared Objects"
    SETLOCAL

:: Delete Local Shared Objects in a very heavy-handed way:

    SET SYSPATH="%APPDATA%\Macromedia\Flash Player\macromedia.com\support\flashplayer\sys"
    SET IE2LSO="%APPDATA%\Macromedia\Flash Player\#SharedObjects"
    SET GOOPATH="%LOCALAPPDATA%\Google\Chrome\User Data\Default\Pepper Data\Shockwave Flash\WritableRoot\macromedia.com\support\flashplayer\sys"
    SET GOOGLSO="%LOCALAPPDATA%\Google\Chrome\User Data\Default\Pepper Data\Shockwave Flash\WritableRoot\#SharedObjects"
    
:: Delete LSO's for IE and FireFox, preserving the flash settings:

    XCOPY /y /q /h /r %SYSPATH%\settings.sol %TEMP%\*
    RMDIR /s /q %SYSPATH%
    RMDIR /s /q %IE2LSO%
    XCOPY /y /q /h /r %TEMP%\settings.sol %SYSPATH%\*
    DEL /f /q %TEMP%\settings.sol

:: Delete LSO's for Chrome, nevermind the flash settings (use defaults):

    RMDIR /s /q %GOOPATH%
    RMDIR /s /q %GOOGLSO%

:: Optionally start one of the browsers.  Also possible to specify a "home" URL here:

    START "" "C:\Program Files (x86)\Google\Chrome\Application\chrome.exe"
::  START "" "C:\Program Files (x86)\Internet Explorer\iexplore.exe"
::  START "" "C:\Program Files (x86)\Mozilla Firefox\firefox.exe"

::  PAUSE
    ENDLOCAL
    EXIT

Put this code in a script file with a .CMD extension, e.g. DELETELSO.CMD.  Then create a shortcut to that script and set Properties/Shortcut/Run to Minimized.  Put the shortcut on your desktop, or Quick Launch bar, or wherever you want it.  Use it any time you want to clear the LSO's.  It can also be used to start the browser of your choice after it clears the LSO's, see the code.  That's how I use it.  If you have trouble copying the code from this screen, try this instead, making your screen wide.

Note:  This is a VERY HEAVY-HANDED way to approach the problem and could produce unanticipated and hard-to-diagnose results.  Please check for problems with your favorite web-based applications before you forget that you did this and start looking for problems in the wrong places.  This script comes with no warranty, and you can only sue me for the amount that you paid for it.

The above script has been tested and is in use on Vista and Windows 7.  It has not been tested on Windows 8, and it will not work without modification on Windows XP.

I've had this in place for several months now, using it to start Chrome any time I want a browser, and have not identified any problems in my use of the Chrome browser.

Comments, complaints?

Friday, March 18, 2011

Use BLAT With STUNNEL To Send Email Via SSL On Windows

An earlier post described a Windows command-line script which sends a detailed email at bootup, like PC Phone Home (tm). It worked on our computers for a year and a half, and then stopped. We discovered that our internet service provider, trying to reduce the amount of spam sent through their servers, had blocked port 25, the standard unencrypted email port. They encouraged their customers to switch to SSL, encrypted transmission, using a different port.

The BootMail script uses a free utility called blat to actually send its email. Unfortunately, blat does not support SSL connections. However another free utility, stunnel (secure tunnel?), can convert data from an SSL-ignorant program like blat and send it to an SSL-aware computer or connection. Stunnel can do lots of other things too, and in fact I found the documentation to be thoroughly daunting, but installation turned out to be quite simple, basically the same on Windows 7, Vista, and XP:
  • Download stunnel-4.35-installer.exe from stunnel.org.
  • Run it and accept the defaults. This installs the software on the disk, in c:\Program Files\stunnel on a 32-bit system or c:\Program Files (x86)\stunnel on a 64-bit system.
  • In Start/Programs go to the new stunnel folder and right-click on "Edit Stunnel.conf." Click Run as Administrator (Vista or W7), or click Open (XP). This brings the configuration file into Notepad with rights to modify it. You may be prompted for permission in this and following steps.
  • Delete everything in the file, and copy in the four lines example below, modifying them for your use. "Accept" is the port on which blat sends the email (this can be changed), and "connect" is the server name and port that your ISP wants you to use. Save and quit.
  • In Start/Programs, right-click "Service Install" and click Run as Adminstrator.
  • In Start/Programs, right-click "Service Start" and click Run as Administrator.
Example stunnel.conf file which could be used to send email through gmail:
client = yes
[ssmtp]
accept  = 25
connect = smtp.gmail.com:465
In the script which runs blat, or in the registry, you will want to specity the server as follows: "-server localhost:25".

(tm) PC PhoneHome is a trademark of Brigadoon Software.