Showing posts with label programs. Show all posts
Showing posts with label programs. Show all posts

Thursday, December 1, 2011

Windows 7: Tweaked Installation: Latest Version

The time came to reinstall Windows 7. This post copies and pastes text from previous posts on this subject, with additions and corrections as needed. (I used this same writeup for later installations, and have modified some of its points accordingly.)  The posts I drew especially from were these:

Note:  there are quickie Windows 7 installation pages.  The focus here is on a tweaked installation, i.e., one that addresses lots of small issues and needs along with the general-purpose installation.  The steps here seemed pretty much the same for 32-bit and 64-bit systems.

The first steps I took in the installation process were as follows:
  • After booting with Ubuntu 10.10 (using the "Try Ubuntu" not "Install Ubuntu" option), I went into System > Administration > GParted Partition Editor. That version of Ubuntu used GParted 0.5.1.  I'd had problems with Ubuntu 11.10, for this purpose, with its apparently newer version of GParted.  If the Ubuntu Live CD had not worked, a bootable USB tool might have been an alternative.  In GParted, I deleted the hard drive partition containing the previous version and created a new NTFS partition.  This worked better than using the partition creation option in the Windows install process.  The partition size was 100GB.  My previous Win7 installations had been about 45GB and then 70GB, but I found the extra space helpful, even though I did not store data on drive C.
  • I installed Windows 7 from the CD into the newly emptied partition. My upgrade version required me to install my full copy of WinXP first, and then install Win7.  During installation, I set a password and instructed the computer to go ahead and install updates.  After the installation, my former Windows XP install had been packaged into C:\Windows.old.  I deleted that.
  • My other drive partitions were already created and labeled.  I had used GParted for that too.  I had to change the drive letters for some.  To do that, I went into Start > search for diskmgmt.msc.
  • I verified that I had only my Administrator account and the Guest account.  This was in Start > Control Panel > View by Small Icons > User Accounts > Manage another account (alternately, Start > Run > control userpasswords2, when I would add Run to the Start Menu (below)).  This way, the changes that I made would all be made to the same account.
  • I turned off User Account Control:  Start > search for UAC > Change User Account Control settings > Never notify.
  • I went to Start > Computer to open Windows Explorer.  I navigated to my INSTALL partition, where I had saved the various programs and drivers that I would be installing.  There were quite a few of these; I made a point of copying stuff from installation CDs to this partition whenever possible, so as to simplify reinstallation.  I also named the folders so that the things to install first would be first in the list, such as "01 Motherboard Drivers."  I had to do some of these (especially installing ethernet drivers and having the router and modem configured) before the Internet connection would work.  I also wanted to have my other hardware drivers (for e.g., the display) in place before Microsoft's Windows Update started detecting optional software and drivers to install; these were drivers that I had previously worked with, so I knew these worked.  The display software took care of most configuration automatically.  For the rest, I went into Start > Control Panel > Display > Change display settings.
  • I connected the Internet cable and went to Start > Control Panel > Windows Update.  I selected all language updates and right-clicked to hide them, and installed the rest.  I re-ran Windows Update until there were no more updates to be had. This brought Microsoft Security Essentials along as free and easy antivirus.  At first, I let the updates run automatically.  Later, I changed Control Panel > Windows Update to a manual setting, to prevent the updater from rebooting the machine inconveniently.  Updates continued to install, requiring occasional reboots, while I proceeded down this list.
  • Somehow, I wound up with two Windows 7 entries on the initial Windows Boot Manager screen.  To get rid of one, I followed advice and went into Start > search > msconfig > Boot tab > select the one that is not the default OS > Delete > Apply > OK.
  • Windows Defender. The Microsoft updates gave me a dialog, on reboot, that said, "This program is turned off." I knew from my previous installation that I might keep on seeing that dialog every time I rebooted.  There were many suggestions on how to get rid of it, and some worked for some people, but none worked for others, including me.
  • I ran Ultimate Windows Tweaker 2.2 (UWT) (saved as a portable app in my Start Menu) and tweaked a number of items, including:  System Performance (enable support for 4GB of RAM on 32-bit Windows OS; Disable Tablet PC Input service); Network Tweaks (disable auto-discovery of media contents in shared network by Windows Media Player); Internet Explorer (uncheck "Open first home page when IE starts"; uncheck "Notify when download completes"); and Additional Tweaks (uncheck "Show 'Search ...'"; show "Take Ownership" and "Move To Folder..."; remove "-Shortcut" suffix for new shortcuts). TweakNow PowerPack 2010 was an alternative to UWT.
  • I now had a "Take Ownership" right-click context menu option in Windows Explorer.  I right-clicked on the top-level folders, for each drive in my system, and selected that Take Ownership option.  This didn't work for the ones that had padlock icons on them, but it seemed to work for the rest.
  • While in Windows Explorer, I right-clicked on each partition (e.g., drive D) and selected Properties > Customize > Optimize this folder for Documents > Also apply this template to all subfolders.  That way, all of my folders would display the same way; there would not be different column headings, in Windows Explorer, for music or picture folders.  The Customize tab was not visible on drive C.  Apparently it would also not have been available if I had been been approaching the other partitions (D, E ...) through Libraries or through some view other than via Windows Explorer > Computer > Drive D (or E, etc.).
  • I made some adjustments in Windows Explorer, under its  Organize option.  One was to go into Organize > Layout > turn on Menu Bar, turn off Details pane.  (Navigation pane was already on.)  I also went into Organize > Folder and Search Options.  There, in the View tab, my changes included show hidden files, empty drives, extensions, and protected operating system files.
  • In the navigation pane of Windows Explorer, I wanted to get rid of Favorites and Homegroup.  The Windows 7 Navigation Pane Customizer appeared to provide this easily.  Previously, I had used the following manual approach instead:  I went to Start > Run > regedit and went to two different locations.  For Favorites, it was HKEY_CLASSES_ROOT\CLSID\{323CA680-C24D-4099-B94D-446DD2D7249E}\ShellFolder.  For Homegroup, it was HKEY_CLASSES_ROOT\CLSID\{B4FB3F98-C1EA-428d-A78A-D1F5659CBA93}\ShellFolder.  In both, the first step was to set Permissions so that I could make the change.  To do that, I right-clicked on Permissions > Administrators > Full Control.  If necessary to make that happen, I went on into Advanced > Owner tab > change owner to me and click "Replace owner on subcontainers and objects" > Apply.  With that taken care of, I could OK out of that dialog.  So now, as advised, I could right-click on Shell Folder > Attributes > Modify.  Both values were changed slightly.  For the former, the desired value was a9400100; for the latter, it was b094010c.  64-bit Windows 7 would require me to do exactly the same thing in a second location.  For Favorites, that location was HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Classes\CLSID\{323CA680-C24D-4099-B94D-446DD2D7249E}\ShellFolder.  For Homegroup, it was HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Classes\CLSID\{B4FB3F98-C1EA-428d-A78A-D1F5659CBA93}\ShellFolder.
  • I ran the Win7RegEdit.reg or the Win7RegEdit-x64.exe file to automate a number of tweaks.
  • I installed Classic Shell, to change the look and some functions of the Windows 7 Start Menu and Windows Explorer to what I considered the more efficient form of Windows XP.  After installing this, I right-clicked on the Start button > Settings > Customize Start Menu > Backup > Load from XML File to restore my previously saved configuration settings for Classic Shell.  This enabled my customized, shared Start Menu.
  • I right-clicked on the taskbar at the bottom of the screen and chose small icons.
  • At this early stage, while messing around with various tasks, I also installed Google Chrome so that I would have a fast alternative browser in lieu of IE 9.  I also installed recommended extensions by going into Chrome's Options > Personal Stuff > Sign In.  Within a few minutes after entering my Sync password, Chrome had installed my previously installed settings.  It also brought Google Earth.  Earth didn't have a way of saving settings, so I used my previously tweaked installation on another computer as a guide to how I wanted it set up.
  • LockHunter.  This very useful bit of freeware would unlock files and drives that did not seem to be in use, but that Windows would nonetheless refuse to move or delete.
  • Bullzip PDF Printer.  Actually my default PDF printer, despite having Acrobat.  Simple, fast, reliable.  My customized Start Menu already had portable PDF readers, in case I needed to read a program's PDF read-me during this installation phase.
  • I created a shortcut to an administrator command (CMD) window on the desktop or Start Menu.  To do this, in Windows Explorer I used File > New > Shortcut.  The target location was C:\Windows\System32\cmd.exe.  I right-clicked on that shortcut and went into the Shortcut tab > Advanced > Run as administrator.  I only had to do this during the first installation.  After that, it was portable to other machines as part of my customized Start Menu.
Now I was getting closer to the point of installing a boatload of programs.  The one other thing to take care of first was to do a tour of those Control Panel items that I had not already adjusted by using the .reg file and other steps mentioned above, and that were not better addressed in other steps described later in this post:
  • AutoPlay:  uncheck "Use AutoPlay for all media and devices."  Turn it back on for video CDs and DVDs.  Set everything else to "Take no action."
  • Device Manager:  check any items showing exclamation marks in yellow triangles.
  • Indexing Options:  Modify > uncheck everything, because I used other programs and didn't need this slowing down my system.  This left only Start Menu and Users on the list.
  • Internet Options:  best done by starting Internet Explorer (IE).  (Windows Updates had installed IE 9.)  There, open all desired home webpages in separate tabs, signing into each as needed.  Then go into IE's Tools > Internet options (Alt-T O) > General tab > Home Page > Use current.  (After the first time, I was able to save these URLs in a text file and just copy and paste them into that Home Page space.)  Also in General tab:  Browsing history > Settings > Move folder > drive X (BACKROOM).  (Ideally, the Win7RegEdit.reg file (above) would have already taken care of this.  Otherwise, I would save this step for last, since it required a reboot.)  Also in General tab:  Search > Settings > Search Settings > Find more search providers.  Also in General tab:  Tabs > Settings > adjust as desired.  Next, Security tab > click on Trusted Sites > Custom Level > Scripting section (near the end of the list) > Allow programmatic clipboard access > Enable.  I saved and closed the options dialog.  I navigated to YouTube.com and played a video, so as to trigger the process of installing Adobe Flash Player if needed.
  • Notification Area Icons (continuing, here, with the remaining Control Panel items):  Check "Always show all icons and notifications on the taskbar."
  • Personalization:  I wanted the Windows Classic theme, Desert colors.  A website offered a bunch of them, including that one.  I downloaded and unzipped it.  That gave me Desert.themepack.  I right-clicked and unzipped that and got Desert.theme.  I put a copy of that in C:\Windows\Resources\Themes.  I closed the Personalization window and then opened it again, and Desert was there.  I clicked on it.
  • Power Options > Create a Power Plan > model it on High Performance > Change advanced power settings.  Adjust as desired.
  • Program Updates:  this was for the annoying InstallShield Update Manager.  It only became available after certain programs were installed.  I went into its Update Settings tab and selected "The InstallShield Update Manager will not automatically check for updates."  An alternative was to root it out, perhaps as advised in my previous post
  • Programs and Features:  Turn Windows features on or off > turn off Games, Indexing Service, Tablet PC Components, Windows Gadget Platform.
  • System:  On the left side:  System Protection > Hardware tab > Device Installation Settings > Yes, do this automatically.  Advanced tab > Performance > Settings > Advanced > Change > Uncheck "Automatically manage paging file size for all drives" and set No Paging File for all drives, with two exceptions:  a 16MB (minimum and maximum) paging file on drive C, and a paging file of 2000 MB (minimum) to 4000 MB (or more) (maximum) on drive X (BACKROOM), where it will not be added to any backups.  (It is necessary to click the Set button after each change.  After exiting this part, go back in to see if amounts recommended or allocated have changed.  A high minimum supposedly saves the system from having to recreate a file of that size.)  System Protection tab > select each drive, one by one > Configure > adjust Disk Space Usage as needed.  In the middle of the list on this System page:  Windows Experience Index:  View and print detailed performance and system information (for future reference).  Towards the bottom: Activate Windows.
  • Windows Firewall:  verify that it's on (unless some other firewall has been installed).
I then began to install my long list of programs, working down through the list of executables that I had saved in the Installed Programs folder (above).  I almost always installed to the default location.  Doing so meant that the shortcut to each program, already sorted into the desired location in the customized Start Menu, would come alive.  In other words, the icon associated with that shortcut would take on color and shape when it became operational.  So then I could easily see if some particular Start Menu program had not yet been reinstalled or was no longer working.

At about this time, I began getting the irritating "Could not find this item" error message.  I rectified it by running a batch file, which I also built into the Win7RegEdit.reg file (above).  I postponed making an Acronis drive image of the installation until I was done with my list of settled programs.  (I kept the installation files for my various programs on my Install partition (drive W), in two separate folders:  after 01 Motherboard Drivers and utilities and 02 Programs Needed Early, these were in 03 Standard Programs and 04 Programs Not Yet Installed (with a few in 05 Run in Virtual PC and 06 One Machine Only (i.e., not installed on both computers).)  Among the standard programs I installed, the ones that may call for commentary included these:
  • Adobe Acrobat Professional.  There were many apparently good freeware or cheapware PDF editing alternatives, but I already had this one.  As I was installing this and other programs, I configured them and checked for updates.
  • Cool Edit 2000.  For audio editing.  Not available anymore:  bought up by Adobe.  It worked fairly well until I installed an Adobe Acrobat update.  I tried fixing it by right-clicking on C:\Program Files\Cool2000\cool2000.exe > Troubleshoot compatibility > Try recommended settings > Start the program.  This didn't work.  There were indications that Adobe was now deliberately torpedoing CoolEdit.  But then, later, it did.  Not sure why.  An alternative was to run it in Windows Virtual PC, which would provide a virtual copy of Windows 98 running within Microsoft's free Virtual PC program.
  • Audacity was a good freeware alternative to Cool Edit.  The version I installed was 2.0.  I had found that 1.2 would not do very well with recording streaming audio in Windows 7 (below).  But I ultimately wound up using Debut for streaming audio.  So I could have just kept a portable version of Audacity on my customized Start Menu, avoiding the need to reinstall it.
  • Copernic Desktop Search.  I configured it to store its cache on drive X (BACKROOM).  I used it for searches of content within files.  I used Everything for fast searches of file names (opened via Shift-Esc, just like Ava Find).  In Windows Explorer, therefore, I right-clicked on each drive > Properties > General tab > uncheck "Allow files on this drive to have contents indexed in addition to file properties" and indicated that this applied to subfolders as well.
  • Firefox and recommended extensions and preferred themes.  I had saved a list of extensions to install using the Infolister extension, and I used that list to search for the ones to install, though I hoped that something like Firefox Sync or FEBE would eventually prove reliable enough to automate this.  I had saved settings from at least some extensions (e.g., Tab Mix Plus, Session Manager) and was able to use those to speed up the reinstallation process somewhat.  Firefox still didn't have a way to save settings, so I had to go back through its tabs and set things to taste.  One setting that was easy to overlook was to brighten up the color of visited links a bit, so that it was easier to distinguish which Google hits I had previously viewed.  For that, I went into Tools > Options > Content tab > Fonts & Colors > Colors.  As with Internet Explorer, I went to YouTube.com, tried to play a video, downloaded the Adobe Flash plugin, and installed it.  I did the same also in Chrome; its Adobe Flash installer applied to Opera as well.
  • Microsoft Office 2003.  Microsoft was no longer making it easy to figure out which updates were needed, but I had previously developed a list, downloaded them manually, and set up a batch file to install them one by one.  So I ran that batch file.  I ran the Office 2003 Save My Settings Wizard to restore previously saved settings.  These, like the settings for some Firefox add-ons (above), were saved in a Saved Settings folder on the INSTALL drive (X).  I also ran the Auto-Correct macro to restore Autocorrect entries.  I also installed some add-ons to enhance Office 2003 functionality.  These steps provoked some more Windows updates.
  • Thunderbird for email.  I had found the installed version to be more stable than the portable one.  At this point, T-bird 5.0 was not supporting the several extensions I had collected (to extract attachments, delete duplicate emails, and export emails to other formats), so I decided to stick with version 3.1.13.  I closed Thunderbird and, inspired by my previous efforts with Thunderbird, went into Start > Run and typed "thunderbird.exe -ProfileManager" (without quotes).  I chose Create Profile > Ray > Choose Folder and selected D:\Thunderbird\Profile.  (I wanted my email and address book to be on a data partition, not on drive C, so that they would be regularly backed up with other data.)  In the Choose User Profile dialog, I clicked on Delete Profile and deleted the default profile, so that Ray was the only one appearing in the Choose User Profile dialog.  This deleted the contents of the default profile at C:\Users\Administrator\AppData\Roaming\Thunderbird\Profiles, but did not actually delete the default folder.  I clicked on Start Thunderbird.  T-bird came up with an error message:
  • Server not found live.mozillamessaging.com could not be found. Please check the name and try again.
    I started a search on this, but then decided to just close that tab and see if Thunderbird was working.  My inbox, archives, etc. all seemed to be there; the address book was available; I was able to send and receive email.  Mission accomplished.  I added the ability to read newgroups by going into Thunderbird > Tools > Account Settings > Account Actions > Add Other Account > Newgroup Account > Next.  I entered a username and a fake email address, the latter because I wasn't sure yet if I wanted to get email from group members.  The Newsgroup Server was news.mozilla.org.  That created the account, which I called Mozilla Newsgroup.  I went into Server Settings for that account and insured that its port was 119.  I clicked on Mozilla Newsgroup in Thunderbird's folders pane and specified mozilla.support.thunderbird as the newgroup I wanted to subscribe to.  I hadn't used newsgroups much since Google had bought and ruined the old DejaNews, but I had heard that Google Groups might someday become useful again.  If I got interested in another approach to newsgroups, there was also the option of subscribing to a usenet server, which would probably involve paying a fee.
  • Glary Registry Repair.  I put a link to this in my Start Menu > Programs > Startup folder so that it would start automatically whenever I started the computer.  In perhaps a year's use, it had seemed to be a highly rated, non-destructive registry cleaner.
  • Freeware PDF Unlocker.  Primarily because some PDF authors put security on their PDFs that prevented me from adding a note indicating where I got the document, and other information needed for academic citations.  Later, I decided I was getting better results from www.FreeMyPDF.com.
  • Google Earth.  I added a registry hack to my Win7RegEdit.reg file (above) to tweak Google Earth.  This tweak automated the setting of the cache size to 1GB of memory and 2GB of disk space.  It also moved the cache to another partition.  Moving it, I hoped, would increase speed, since another drive would be handling some of the data.  It would also remove the potentially large cache from backup images of my program drive.  Before this tweak, I had a 131MB dbCache.dat file (plus dbCache.dat.index and others) in C:\Users\Ray\AppData\LocalLow\Google\GoogleEarth.  After this tweak, upon restarting Google Earth, I had a file of that size in the target folder I had created at X:\Cache\Google Earth.  I browsed in GE to Beijing, and on to Moscow, and then sent GE slowly wandering eastward over the Russian forest, and yet dbCache.dat did not increase in size.  I closed GE, removed dbCache.dat from C:\Users\Ray\AppData\LocalLow\Google\GoogleEarth, and restarted GE.  Functionality remained.  The tweak appeared to work.
  • TClockEx.  To provide customized date and time readout in the system tray.  My preferred format:  ddd, MM d, yyyy - h:mm:ss tt.  For a 64-bit version, see Stoic Joker's adaptation.  To make sure the computer's time was accurate, I used a registry edit to add Internet sources and choose NIST.
  • WinRAR.  I had 7zip as a portable, but was beginning to like this more than that.  Its warnings said it was only good for 40 days, and I hadn't yet been using it that long, so I wasn't sure what would happen at that point.  But it sure did have a lot of people downloading it.
  • I had installed BinManager, as a way to automatically empty out items in the Recycle Bin after they had sat there for a while.  But I couldn't find a way to configure it.  I uninstalled it and tried Autodelete instead.  I wasn't happy with that either.  Eventually I just added this line to a batch file that ran weekly:  start "" emptyrecyclebin.exe.
  • I finally broke down and bought a copy of Debut for screen capture.  I just hadn't found any good freeware.  CamStudio worked sometimes, not other times.  NCH Software, creators of Debut, were excessively touchy about licensing.  Reinstalling Windows on the same computer, where I simply decided to change the name of the computer, was enough to prevent me from being able to use my paid copy of their software.
A few programs worth mentioning in the area of noninstallation or uninstallation:
  • Adobe Reader, which must have been pre-installed by ASUS.  I didn't need it, with Acrobat installed.  But then I decided it wasn't hurting anything, and I'd have it if Acrobat malfunctioned, so I left it alone.
  • I decided not to install software for my digital camera.  I found that Windows Explorer could see the contents of that device as soon as I plugged it in, without the need for bloatware.
  • I installed Virtual CloneDrive so that I would have the capability of mounting an ISO image as though it were a mounted CD, without having to actually burn the ISO to a CD and then put the CD in my CD drive.  Unfortunately, there was no way to keep it from starting with Windows.  I used it too rarely to have that extra clutter, and therefore thought about uninstalling it and just reinstalling when I needed it.  It created "BD-ROM Drive (F:)."  In Disk Management (diskmgmt.msc), it showed up as a second CD-ROM drive, and its Properties called it "Elby Clonedrive SCSI CdRom Device," whereas its Properties > Hardware tab > Properties in Windows Explorer said it was a "NEC DVD_RW ND-3550A ATA Device." I went into Control Panel > Programs and Features and saw that "Elby" was apparently shorthand for "Elaborate Bytes," maker of VCD.  (Note that VLC was also able to play videos saved in ISO format, without any need for mounting them as separate virtual drives.)
Next, I set up various scheduled items:
  • Defragmentation.  Start > Run > dfrgui.exe > Configure schedule > Daily (so as to run in small, relatively non-bothersome tasks, without having to keep the computer on at night) > Select all disks.  But later, when I found dfrgui.exe choking on a USB drive, I went back to Smart Defrag.
  • Daily and other scheduled batch files, including an internal backup batch file that used a Robocopy script.  These would run programs, open Firefox tabs, or otherwise do things that I needed to do at a certain time every day, or on a certain day of the week, month, etc.  These scheduled items could be exported from Task Scheduler and imported into new installations, so they would not have to be re-entered manually.
  • Create System Restore Points at regular intervals.  I downloaded the Instant_Restore_Point.vbs script and added a line to my daily batch file, so that I would have at least one such restore point each day.
Finally, I turned to miscellaneous tweaks and adjustments:
  • Installing the programs listed above gave me a large number of duplicative Start Menu entries.  (My customized Start Menu, saved on D, already had links to those programs, sorted into various categories for easy access.  When I reinstalled the programs, those already-sorted shortcuts worked again, so I didn't need the new ones that the programs had installed on the desktop and in the top level of my Start Menu > Programs.)  To get rid of the duplicates, I put all the new shortcuts into a separate folder and ran a DoubleKiller comparison of that folder against my customized Start Menu.  Very few had the same size and CRC numbers.  Many had the same names, but I could not have any global certainty that the ones already existing in the Start Menu were still working.  Ultimately, I just manually re-sorted many of these new shortcuts, overwriting the old ones in the event of conflict.
  • To get windows to stay in the size and position where I put them, I tried an approach that had sometimes worked for me:  right-click on the title (top) bar of a Window.  Choose "Size."  Drag the window and its edges somewhere and then let it go.  If it doesn't respond, trying using arrow keys.  Then click on the top right X to close the window.  I almost thought that approach was working for me.  Some people said that FileBox eXtender or WindowManager would fix this.  At this point, I was just beginning to try ShellFolderFix for this purpose.
  • To prepare Audacity to record streaming audio, I took the advice to go into Control Panel > Sound > Recording tab > right-click anywhere in the white space > Show Disabled Devices > right-click on Stereo Mix > Enable.  Right-click on Stereo Mix again > Set as Default Device.  Then I went into Audacity > View > Toolbars > make sure Device Toolbar is checked.  The location of that toolbar apparently shifted, from one version to the next.  In my version, it appeared slightly to the right of the center; in others, it ran across the top line.  It apparently reflected the same thing as in Edit > Preferences > Devices.  The Device Toolbar had drop-down boxes listing various speakers and microphones.  There, in the first box, I selected Windows DirectSound, and in the third box I selected Primary Sound Capture Driver.  (Some versions of Audacity apparently combined the two into one.)  This approach had worked previously, but did not work on this new installation; I was not able to record streaming audio. Back in Control Panel > Sound, I could see the level meter moving on my headset's microphone; the mike was picking up what was being played in the headset's ear speakers.  But the Stereo Mix item was not showing any such action.  I tried the approach of using a cable to connect the computer's Line In and Line Out (or, on my computer, Front Speaker Out) ports, but that didn't work either.  It seemed to be a hardware problem.  So this was still a work in progress.
  • Shellstyle.dll.  I had modified this file to hide the command bar (i.e., the folder band) in Windows Explorer.  Now I needed to put it into C:\Windows\System32.  Despite taking ownership of the System32 folder, I still had to take ownership of the Shellstyle.dll file within it, in order to replace it with this other Shellstyle.dll file.  Later I decided that I sometimes needed the folder band.  I had renamed the old one to be shellstyle.old, so I could presumably have gone back if I'd had a burning need.
  • To get Windows to stop asking if I was sure I wanted to delete files, I right-clicked the Recycle Bin icon on the desktop > Properties > uncheck "Display delete confirmation dialog."
  • To make Internet Explorer stop offering to "Speed up browsing by disabling add-ons," I took the advice of Pete, who posted a comment on my previous post.  Pete's advice was to go to Start > Run > gpedit.msc > Computer Configuration > Administrative Templates > Windows Components.  In the left pane, under Windows Components -- not a subfolder, but a sort of subentry, made more visible by double-clicking again on Windows Components -- there was an All Settings option.  I clicked on that.  This opened a long list of items in the right pane.  One was "Disable add-on performance notifications." I double-clicked on it and selected Enabled and then bailed out.  I hoped that would solve the problem.  It didn't.
The last step was to synchronize the new Win7 installation with other computers.  This time around, I was not having the IP Address Conflict problem I'd had previously.  I just had to do basic networking and set up GoodSync.

Tuesday, July 5, 2011

Windows 7: Batch Files That Run Things on a Schedule

I was using Windows 7.  I had a bunch of things that I did every day, other things that I did every week, and so forth -- semimonthly, monthly, quarterly, yearly.  I found that these items could be run from within batch files, and that I could run those batch files using Task Scheduler.  This post summarizes some of those arrangements.

The first step was to create a batch file.  Here are the contents of a sample DAILY.BAT file:

echo Ready to open Explorer sessions and projects.
echo.
echo.
echo First, it's time to exercise!
echo.
echo Then move to the last open tab in Firefox.
echo.
pause
cls

:: Regular daily stuff

start Excel "D:\Spreadsheets\Exercise Results.xls"
start sfc /verifyonly
del "X:\Cache\Junk Temp Folder\*.tmp"

:: Open Firefox webpages

start firefox "http://www.thehungersite.com"
start firefox "http://www.npr.org/series/4703895/song-of-the-day"

:: Open folders

start explorer.exe /e,"D:\Folder1\Subfolder1"
start explorer.exe /e,"D:\Folder2\Subfolder2"

:: Not using now

:: start "" "C:\Program Files\Microsoft Office\OFFICE11\Winword.exe"
:: start "" "W:\Start Menu\Programs\PortableWinampLite\winamp.exe"

Using Notepad, I put materials like these into a text file called DAILY.BAT.  The BAT extension would notify Windows that this should run like a program.  The first commands shown here would clear the screen in a CMD window (CLS), show statements (using various forms of ECHO), run the System File Checker (SFS), delete the TMP files from a certain folder, and start various other programs.

All kinds of programs could be started this way.  The information about where to go to start them was usually available in the Properties of shortcuts to them found in the Start Menu.  Some examples here included tabs that open in Firefox (having set Firefox to open new links in new tabs), new sessions of Windows Explorer (opened with a focus on a particular folder), and Microsoft Word and Excel.  The command pointing to Word, and also the one pointing to Winamp, are commented out here (i.e., there are double colons in front of them), because I decided I didn't need them now, but I didn't want to forget how I had set them up, in case I did start to use them again).

Note the two different ways of starting Word and Excel shown here.  Both ways would work for either program; they just show two different approaches.  The reference to Word (i.e., winword.exe) included a full statement of its path, contained in quotation marks, and without specifying a particular file to open.  (The double quotation marks at the start of that Word command solved the problem that some programs would not start unless they were preceded with a dummy variable.)  But the reference to Excel just said "Excel."  That Excel command worked because I put a shortcut to Excel, called simply "Excel," in C:\Windows.  I kept a folder with a half-dozen of these kinds of shortcuts, for different programs that I would invoke frequently, and I would copy them to C:\Windows whenever I reinstalled Windows 7.

I was able to set up batch files like this DAILY.BAT example for any timeframe.  I could have had one called EVENING.BAT, or 10AM.BAT, or MONTHLY.BAT.  I would keep them in a folder on my Start Menu, so that I could run them manually or easily find them for a quick right-click > Edit.

The next step would then be to make them run on a schedule.  This called for running Task Scheduler.  Since I had a Run option on my Start Menu, I would just go to Start > Run > taskschd.msc.  An alternative would be to search for Task Scheduler.  There, I would go to Actions > Create Basic Task and go through the steps of the setup wizard.  When that was done, if I right-clicked on that task and looked at its tabs, I would verify these settings:
  • General tab:  Run with highest privileges; Configure for Windows 7.
  • Triggers:  Enabled.
  • Actions:  Start a program:  DAILY.BAT.  Start in:  insert the path to the place in the Start Menu, or wherever DAILY.BAT is stored.
Other settings might also have to be configured for the particular purpose.  I tended to favor settings that would let the program run whenever the computer was next turned on, so that I wouldn't have to leave the machine on all the time to be sure of letting everything run right when Task Scheduler said it should.

The general idea is that, with a scheduled batch file, I could change the things that would happen at 10 AM, or whenever the batch file was scheduled to run, by just editing the batch file in Notepad.  Anything that I would do every day, or on the fifth day of every month, would run automatically.  I might have to run it a couple of times to work out the bugs, but then it would just do its thing with no further involvement by me.

Thursday, January 13, 2011

A Tweaked Windows 7 Installation: Second Try

I was installing Windows 7.  I had spent days exploring various possibilities.  Unfortunately, I had also acquired a networking problem for which a new installation seemed to be the only solution.  This post consolidates what I learned in the first installation attempt, and adds some new items.  As in that previous post, some of these items were recorded after the fact, and may not look or function precisely as described here.  For example, settings may already have been changed by the time they come into focus in the sequence described here.
My first step was to delete all accounts except the Administrator and the Guest.  The changes described here thus had to be made only to the Administrator account.  I also allowed Windows and other updates whenever they seemed to be ready for installation.  In Windows Update, after installing desired updates, I highlighted all unwanted updates (e.g., foreign language packs) > right-click > "Hide updates."

I made some preliminary adjustments in Windows Explorer.  These included Organize > Layout > Details pane, right-click on the menu and turn on Classic Explorer Bar, and also in Windows Explorer, in Tools > Folder Options.  Also, in my early usage of Internet Explorer, I allowed it to turn on AutoComplete (Tools > Content > Settings).  (This did not fix the perennial problem of IE not remembering passwords, by the way.)

During the first installation, I organized programs that I was installing (including drivers, batch files, and other materials) into folders.  I numbered the folders (01, 02, 03 ...) so that they would appear in the correct sequential order in Windows Explorer.  The contents of all of these folders had to be checked to make sure that I was using programs and other materials designed for Windows 7.  Some but not all of my Windows XP programs fit that description.  The first several folders, at this point, had these names:

01 Motherboard Drivers and Utilities
02 Programs Needed at Start
03 Other Installation & Tweaking Programs
04 Broadly Useful Programs
05 Experimental and New Programs
The contents of folder 05 are addressed in later posts.  This post goes up through folder 04.  In other words, this post describes what I installed, and how I adjusted it, to set up a general-purpose system, mostly using software that I had used previously.

Folder 01 contained several subfolders, likewise numbered sequentially.  The first contained drivers that I would need to load during the Windows 7 installation process if I wished to install Win7 in a RAID array.  I had decided against that.  The second subfolder contained drivers to be installed after the basic Windows 7 installation.  I installed these, and continued on to install motherboard utilities.
Folder 02 contained a few items that I found very useful during the installation and setup process:
  • Antivirus.  I was currently using just Microsoft Security Essentials and Windows Defender, for convenience during installation.
  • AvaFind Professional.  A program that quickly finds filenames.  Some program of this sort was invaluable for locating files needed for various purposes during installation and tweaking.
  • 7-Zip.  Programs to be installed, that had to be downloaded, often came in zipped format.  Windows provided an unzipping feature, but this one was more versatile.
  • Google Chrome.  I found it easier to use Chrome, rather than Internet Explorer, to search for installation-related information.  Turning on Chrome's sync feature minimized the time needed to configure this tool.  Basically, my list of favored extensions was available as soon as I installed Chrome.
  • Bullzip PDF Printer.  There were a few items that I wanted to save as PDF during this process.
  • Router driver and utilities.
Folder 03 contained hardware drivers, registry edit (.reg) and batch (.bat) files used to configure the system, and other programs needed for the basic installation and tweaking process.  The previous post describes most of the materials in this folder.  I have added links in the following list to those that are not mentioned in that previous post.  For the most part, I ran straight through these materials, installing them all after the initial Windows installation.  I installed the programs before turning to the manual tweaking tasks (below) because these programs would take care of some of those tasks automatically.  The programs I installed at this point, in approximately this order, were as follows:
  • Printer drivers and utility software.
  • Win7NewInstall.bat and Win7RegTweaks.reg.  These contained a collection of registry tweaks and other adjustments and customizations.
  • Classic Shell, to change the look and some functions of the Windows 7 Start Menu and Windows Explorer to what I considered the more efficient form of Windows XP.  I went ahead and configured these items at this point.
  • Somehow Windows Live Essentials came up, asking how much of Live Essentials I wanted to install.  I chose Messenger, Movie Maker, and Windows Live Mesh.
  • The first time I tried to play an audio file, Windows Media Player popped up and had to be configured.
  • IOBit Smart Defrag.  I had used this defragmenter for several years and had no problems with it.
  • LockHunter.  This was experimental, for me -- a replacement for Unlocker.  Preliminarily, it appeared less functional.  I wanted integration with the Windows Explorer context menu.  I hoped for a Win7-compatible update of Unlocker.
  • QuickTime.  It appeared that several other programs depended upon this program being installed.
After installing those necessary programs, I changed the following items from the default in Ultimate Windows Tweaker (clicking Apply after each bullet point):
  • Personalization:  Hide detail pane.
  • User Accounts & UAC:  Enable admin approval mode for the built-in administrator account.
  • System Performance:  Enable support for 4GB of RAM on 32-bit Windows OS.  Disable Tablet PC Input service.
  • Network Tweaks:  Disable auto-discovery of media contents in shared network by Windows Media Player.
  • Internet Explorer:  Uncheck "Open first home page when IE starts."  Uncheck "Disable IE check for updates."  Uncheck "Notify when download completes."
  • Additional Tweaks:  Uncheck "Show 'Search ...'"  Show "Move To Folder..."  Remove "-Shortcut" suffix for new shortcuts.
  • It appeared, in some cases, that Ultimate Windows Tweaker was not always effective.  I installed TweakNow PowerPack 2010 and used it to deselect drives not to be displayed in Windows Explorer (in my case, floppy drive A). This setting was in Windows Secret > Windows Explorer.
After restarting the machine, I made changes in Control Panel.  These, too, follow but also modify the steps described in the previous post.  Some (Action Center, Administrative Tools) had already been done in previous steps (e.g., while installing updates or resizing partitions)  Auto-Play was already set the way I wanted, which was suspicious:  had I made more changes to the two-week-old image on which I was doing these tweaks than I had recorded?  Likewise for Personalization (Windows Classic theme. Window Color > Adjust at least Active Title Bar, Inactive Title Bar, Menu, and Desktop).  Regarding Backup and Restore, I was still using Acronis as a fail-safe, but was also using the Win7 system image option.  I would make both after completing some more tweaks.  For regular data backup, I was still using Beyond Compare, which I found was pretty good at showing me when I had nested files too deep. 

Control Panel options still requiring attention were as follows:
  • Internet Options: I went into General tab > Tabs > Settings > adjust as desired. I went to Security tab > Custom Level > Scripting section (near the bottom) > Allow programmatic clipboard access > Enable. I saved and closed those.  I went into Content tab > Autocomplete Settings > turn on.  Then I navigated to YouTube.com and played a video, so as to trigger the process of installing Adobe Flash Player.
  • Power Options: Show additional plans > High performance > Change plan settings > Change advanced power settings > Change settings that are currently unavailable > High performance > change individual items as desired > Apply.
  • Programs and Features: Turn Windows features on or off > Make sure Indexing Service is off.
  • System: Windows Activation > Activate. System Protection > Hardware tab > Device Manager > verify no yellow-circle exclamation marks. Hardware tab > Device Installation Settings > Yes, do this automatically. Advanced tab > Performance > Settings > Advanced > Change > Uncheck automatically manage paging file size for all drivers; instead, set a paging file of 4000-8000 MB (or more) on each hard drive (not on each partition). System Protection tab > Configure > adjust Disk Space Usage as needed.
  • Taskbar and Start Menu: Start Menu tab > Customize. Adjust various items to taste. Turn on Run command. Save and close.
Additional tweaks:
  •  I now had a more or less complete approach for developing a custom-organized Start Menu on a drive other than drive C, where it could be shared with other computers and would survive a Windows crash and reinstallation.  As described in the previous post, Win7NewInstall.bat, used in the previous installation, had created a so-called God Mode folder on this Start Menu.  That folder was still there, so I did not need to recreate it.  I just needed to get around to distributing, across my Start Menu, the shortcuts to every Windows function that I had created via the God Mode folder.
  • As advised, I used Resource Hacker to open C:\Windows\System32\Shellstyle.dll.  There, I went into UIFILE > 1 > 1033.  I searched (Ctrl-F) for the line that said, <style resid="FolderBandStyle">.  I inserted this code after that line:  <if mousefocused="false" mousewithin="false"><Element padding="rect(0rp,0rp,0rp,-28rp)"/></if>.  I left it conditional, able to come up on a mouseover, because I wasn't sure if I might need it in the future.  Later, if possible, I would make this change permanent, without the mouseover option, by inserting only the "Element padding" portion of the line.  With this change made, I clicked on the Compile Script button, there in Resource Hacker. Then I saved the file as Shellstyle.dll in a backup location, so I would not have to do this again.  I right-clicked on C:\Windows\System32\Shellstyle.dll and took ownership, using one of the tweaks installed above.  I copied that backup Shellstyle.dll to C:\Windows\System32, overwriting the existing Shellstyle.dll there.  Then I logged off and back on to see the change.
  • Shut off an annoying question. On the Desktop, right-click Recycle Bin > Propeties > deselect "Display delete confirmation dialog."
  • To make Windows remember size and position of a window, I found two solutions mentioned near the end of a very long thread on the subject.  What worked for me:  right-click on the title (top) bar of a Window.  Choose "Size."  Drag the window and its edges around.  Even if it's exactly where you want it, move it somewhere else and then back, all in one motion.  Then click on the top right X to close the window.  If that technique hadn't worked, I would have gone on to try ShellFolderFix.
  • Every time I started the system, Windows Defender would give me the message, "This program is turned off."  Someone said Windows Defender was unnecessary if I was running Microsoft Security Essentials.  Posts in that thread suggested many remedies, almost none of which worked for the original poster.  A post about two-thirds of the way down that thread offered a solution that worked for me.  I added that solution to Win7NewInstall.bat.
  • Somehow, a Boot folder wound up on drive D.  A thread suggested that (as administrator) I type "bcd c:\Windows /s C:" to get that folder onto drive C with the other system folders.  Before doing that, I made a System Restore point.  To do that, I went into Control Panel > System > Advanced system settings > System Protection tab > Create a restore point.  Then I went ahead with that bcdboot command.  It said, "Boot files successfully created."  I looked at C and, sure enough, there was now a Boot folder there too.  (Maybe there had been before; I hadn't thought to look.)  Now, as advised, to delete that hopefully unnecessary Boot folder, I tried steps through the user interface (taking ownership of the folder), but those did not work.  Using another approach, I went to Start > "cmd" and typed these commands (running as Administrator):
Finally, folder 04.  These were the programs, mostly familiar but some new, that I installed to set up a complete system.  These were as follows:
  • Adobe Acrobat.  I already had a copy, else I would have considered checking out some of the steadily more competent freeware alternatives.
  • Adobe Premiere Elements.  I found that a basic ability to do some video editing was valuable for many purposes.
  • CamStudio.  I was not yet finding good freeware alternatives.  CamStudio, at this point, still did not have a Windows 7 compatible version, so this was a tentative solution.  I was considering buying a copy of Debut, which had done screen video capture pretty well during my trial use of it.  I also installed Jing as an alternative, though it seemed to me that I had already tried and rejected it once if not twice.  When I rebooted, there was suddenly an unexplained, virus-looking dialog offering to let me "Enter or Create a Screencast Account."  When I figured out that this was Jing's doing, I went ahead and created the account.
  • CoolEdit.  An old audio-editing program that still had capabilities and familiarity.
  • Copernic Desktop Search.  My search had led to this as the best desktop search option, much more useful than Google Desktop Search had been.
  • Gadgets.  These were new in Vista and Win7.  Mine were not currently arranging properly on the desktop.  I was not sure how much I would use them.
  • Microsoft Office 2003.  I had OpenOffice Portable already in place as an alternative.
  • Shortcuts to copy into C:\Windows.  As noted in a comment following a previous post, I had discovered that putting shortcuts to programs would make them available for easy reference in batch files.
  • Aqua Deskperience.  I had bought this for capturing text from a region onscreen.  There were freeware alternatives that did the same thing now.
  • EditPadLite.  A Notepad alternative.  After installing this, I decided to rely on Notepad++ instead.
  • File Checksum Integrity Verifier.
  • Firefox.  The portable version had not been reliable for me.
  • Freeware PDF Unlocker.  Drag a PDF onto this desktop icon to make a non-locked copy, so that you can add highlights and comments.
  • Glary Registry Repair.  My Windows 7 replacement for Advanced WindowsCare V2 Personal.  A registry cleaner that I planned to run each time the system started.  I put a shortcut to it in the Start Menu's Startup folder.
  • Google Earth.
  • Handbrake.  For video conversions.
  • iRotate.  Turn the monitor on its side for improved screen captures in some cases.
  • Oxelon Media Converter.  Valuable context-menu addition for all sorts of conversions (e.g., getting audio out of a video file).
  • Paradox dBase Viewer.  For extracting data from old Paradox for DOS files.
  • Skype.
  • TClockEx.  For giving me date and time in the system tray.  I didn't have those because I was using Win7's classic desktop skin.
  • Thunderbird.  For email.  Again, the portable version wasn't up to the job.
  • Total Commander (above).  I wasn't actually using it much, though.  I had largely managed, by this point, to tweak Windows Explorer to suit me.
Note that these were in addition to portable (i.e., standalone) applications that I already had in place and was using for many purposes.  Those were incorporated into my customized Start Menu (above) and therefore did not need to be reinstalled, or even relinked in my Start Menu, at this point.

This gave me a complete working Windows 7 installation.  It represented a great improvement over the previous try.  I was sure there would be further ways to streamline it in future installations.
takeown /f D:\Boot /r /d y
icacls D:\Boot /grant administrators:F /T

Tuesday, December 29, 2009

Ubuntu: Schedule Items with Cron

I wanted to schedule regular backups in Ubuntu 9.10.  I had already worked out the rsync commands I wanted to use; now it was a matter of running them automatically at certain times or on certain days.  I began by seeing what was already scheduled in my crontab (i.e., my chronological table).  Actually, I had two of them:  one for me, and one for the root (i.e., administrator).  I checked them with "crontab -l" (that's a small L) and "sudo crontab -l" and both say "no crontab."  This supposedly meant that there were no crontab files in /var/spool/cron/crontabs.  I verified that via "sudo nautilus."  It seemed like that would apply to the root's cron, but I wasn't able to find any different location where the user's cron should be, so I just moved on to the next step.

The next step was to edit the crontab by using "crontab -e."  This seemed to be creating a crontab for me, as distinct from root:  it said "no crontab for ray - using an empty one."  To confirm that, I tried in a separate Terminal session with "sudo crontab -e."  It seemed to flash the same choice as had appeared for me, showing a choice of editors; but then it went directly into nano, which the other Terminal session was describing as the "easiest" of the three available editors.  So, OK, since I ordinarily ran my rsync backups as me, user, not as root, I figured I would want to set up my own crontab, not a root crontab.  (Later, I found some statements that it was a bad idea to edit root's crontab.)  So I killed that nano session and went back to the first Terminal session.  There, I chose no. 3, nano, as my editor.

The top of the nano screen was showing me "# m h  dom mon dow   command."  This was my cue for the things that I needed to enter on a line, in order to schedule a cron job:  minute, hour, day of month, month, day of week, and command.  (The leading # was to indicate that this sample line was just a comment and should not be executed.)

According to About.com, up through the week level, permissible values began at zero:  that is, minutes of the hour ran from 0 to 59, hours of the day ran from 0 to 23, and days of the week ran from 0 to 7 (where Sunday was both 0 and 7, as you prefer).  Beyond that, days of the month ran from 1 to 31, and months of the year ran from 1 to 12.  If they had names, you could use their first three letters (e.g., "Mon" and "Jul" but not "minute 23"). Cron uses the union (not the intersection) of the two day commands.  That is, if you specify a day of the week (e.g., Fri) and also a day of the month (e.g., 15), the command will run on both days (e.g., every Friday, and also the 15th of every month).  You could use an asterisk to indicate "every"; for example, * * * * * would indicate that you want to run the command every minute of every hour of every day of every month.

There were additional options for numbers below the date level; that is, these wouldn't work on days of the week or of the month.  One of these options was to use fractions:  for instance, */4 would mean "every fourth" minute or hour or whatever.  You could also use a range:  40-45 would mean it should run every minute of the hour from 40 to 45 minutes (i.e., 12:40 AM, 12:41 AM, 12:42 AM . . . 12:45 AM, 1:40 AM . . . 11:45 PM).  You could use lists, separating items with commas, so that 40,41 would mean that it should run only on the 40th and 41st minutes of the hour. So designating the hour as 0-11/2 would mean that it should run every other hour, in the morning only.  You could use a list of ranges; for example, an hour designation of 0-1,10-11 would indicate that the command should run in the first two and also in the last two hours of the morning.  Range and list commands start on the first number; for instance, 2-6/2 runs at 2 AM, 4 AM, and 6 AM (at whatever minute you specify).

There was one other category of entry:  special words.  These words would replace all five numbers.  In other words, if you wanted the precise control offered by the numbers for minute, hour, etc., use the numbers; but if you want the convenience of just entering one word without having to think much about what it means, use the word.  These special words were @reboot (run at reboot), @yearly or @annually (once a year), @monthly, @weekly, @daily or @midnight (run once a day), and @hourly.  These all run as soon as the time period starts (e.g., January 1, 12:00 midnight).  There was more to know about these commands, in the official documentation.

I decided the first thing to schedule was a backup of my CURRENT partition to a backup internal hard drive.  I wanted this backup to run several times a day.  I hadn't set it up as a RAID array because I didn't want it to happen immediately; I wanted to allow some time in case I accidentally deleted something, or made some other stupid mistake.  The more frequently it ran, the more likely it would contain the most recent version of the relevant folder - which could mean it would be more likely to have the version that existed *after* my stupid mistake.  My compromise was to set it up to run every two hours.  The cron line I used, then, was this:

0   */2   *   *   *   [rsync command]

In crontab, I put several spaces between the numbers for readability.  Here, in this blog posting, I had to use nonbreaking spaces for the display shown above, because plain old spaces tend to get ignored in HTML.  I haven't reproduced, here, the long command that I want executed, because I want to focus on the cron parts of the line.  (The rsync command of choice is shown in the previous post.)

Then it occurred to me that, instead of putting that long command in cron, where I would have to do some minor translation every time I wondered what it meant, I could probably write a basic Ubuntu shell script that would do the same thing and would allow me to add explanatory notes and other commands.  So I took a brief detour into the land of scripts.  By the time I returned and finished my look at rsync, I had two scripts.  One was called backup-hour.sh, to be run every few hours.  The other was called backup-day.sh.  I put them into /home/ray/bin and wrote the following cron lines for them:

0   */2   *   *   *   ./home/ray/bin/backup-hour.sh

0   2   *   *   *   ./home/ray/bin/backup-day.sh

The first one would hopefully run backup-hour.sh every two hours, all day and all night.  The second one was intended to run backup-day.sh every day at 2 AM.

To put these lines into crontab, I typed crontab -e.  It all looked good.  But nothing was happening.  A couple of days went by, and cron didn't run.  The problem, I suspected, was with those periods I had put at the start of my path names.  I had thought that was part of a command, but nobody else was using them in their cron files.  So I deleted those and waited until the next even-numbered hour, to see if backup-hour.sh would run.

Then I wondered whether I was saving crontab in the right place.  I noticed that nano, my default crontab editor, was saving it to /tmp/crontab.zfItNF/crontab.  Somehow, that didn't look right.  I did a quick search and found a variety of theories on where crontab should be, and none of them involved the /tmp folder.  Someone suggested typing "which crontab" at the prompt.  That came back with /usr/bin/crontab, which wasn't one of the options those other people had suggested.  I tried to save this crontab to /usr/bin/crontab and got a message that the file already existed.  I tried "gedit /usr/bin/crontab," but even with sudo I got a message that the file could not be opened.  I decided to pass on that one for the time being and, selecting a seemingly knowledgeable opinion, I thought about saving it in /var/spool/cron.  It turned out that there was a subdirectory there, and more specifically we had a file called /var/spool/cron/crontabs/ray.  When I looked in that, I saw a copy of my crontab file, the one that nano had been trying to save in a /tmp folder, except that it began with the line, "DO NOT EDIT THIS FILE - edit the master and reinstall."  So it seemed that maybe nano knew what it was doing after all.  So I let nano save crontab in that /tmp folder after all.  Then, following some advice, I decided to output the error messages, if any, to a crontab.log file.  So the first complete line in my crontab looked like this:

0 */2 * * * /home/ray/bin/backup-hour.sh 2>> /Folder1/crontab-errors.log

Unfortunately, at 4:00 PM, nothing happened.  I decided to follow the suggestion that it is much easier to use the gnome-schedule package (though there were problems for those who upgraded from Ubuntu 9.04 to 9.10 rather than doing a fresh install), so I installed that in Synaptic.  This gave me a new option at Applications > System Tools > Scheduled Tasks.  (Scheduled Tasks was apparently a simple front end for cron.)  But before Scheduled Tasks would work, I had to make sure that crontab and a program called At were installed.  Both were marked as installed in Synaptic.  Cron was for recurrent tasks, and At was for one-time jobs (e.g., run this "At" startup).

The basic idea, it developed, was that crontab -e would add scheduling files to the /var/spool/cron/crontabs folder, but it was apparently advisable to just let crontab -e do that, and not try to find and edit those files directly.  I tried typing "sudo /etc/init.d/cron restart," but that gave me a suggestion:  "Rather than invoking init scripts through /etc/init.d, use the service(8) utility, e.g. service cron restart."  So, OK, I tried that.  This gave me a long message that started with "restart: Rejected send message."  That didn't sound good, so I tried "ps -eaf | grep cron" and that gave me these three lines:

ray       8381  8343  0 19:46 pts/0    00:00:00 man 5 crontab
root      8409     1  0 19:50 ?        00:00:00 cron
ray       8416  8343  0 19:52 pts/0    00:00:00 grep --color=auto cron

When I had tried running that command previously, I had gotten only the second and third lines, not the first.  So perhaps the problem had been that my cron had not been running when I had tried to run it previously, and now it was running.  On that assumption, I could have just gone back to the command-line approach at this point, but I liked the added option of using At to schedule one-time events. But as I checked further, "crontab -l" said "no crontab for ray," so apparently crontab was *still* not running.  But no, one source said, "The output: no crontab for [username] means crontab is installed."

I found a long thread that told me I could use gedit instead of nano, to edit crontab, by typing this:

export EDITOR=gedit && crontab -e

(The "&&" part combined separate commands; apparently I could have achieved the same thing by typing these two on separate lines.)  Someone said I could make this permanent by putting the command in my .bashrc file, which they said I would find in /home/ray, which was true.  But if .bashrc hadn't been there, apparently I could have used gedit to create it, with something like this:

# .bashrc - bash config file #
# export variables
export EDITOR=gedit

Since .bashrc was already there, I just added those last two lines to the end of it.  But anyway, back at the cron issue, someone in that long thread said I could change my cron line to look like this:

* * * * * export DISPLAY:=0 && xterm [command]

if I wanted to see something on the screen when the command was executing.  But this got me back to the realization that, for all of the flexibility I was seeing as I worked my way through page 9 of that very long thread, I would probably prefer, right now, to just get something working.  So I guessed that Scheduled Tasks would work just fine if plain old crontab was working.  So, as others had done, I wrote up a simple command to test crontab.  The entry looked like this:

* * * * * export DISPLAY:=0 && xterm dir

Sadly, this did nothing.  I opened Scheduled Tasks, thinking I would try something similar there, and instead I saw that my crontab line was already there, albeit in ugly form: 

Recurrent    At every minute     export DISPLAY:=0 &amp&amp dir

Anyway, that didn't seem to be running, so I deleted it, in Scheduled Tasks, and tried doing similar as a one-time task.  Here's what I ran:

dir > /home/ray/DIRDIRDIR

and it worked!  I got a text file named DIRDIRDIR that contained a directory listing.  So it seemed the one-time part of Scheduled Tasks was working properly.  So I returned to the question of recurrent tasks.  I remembered that, in Ubuntu, we use "ls" rather than "dir."  So in Scheduled Tasks, I used more or less the same command to append updated directory listings each minute, showing the time when DIRDIRDIR had been last updated:

ls -l >> /home/ray/DIRDIRDIR

and that worked too.  So now I felt I should try again with the lines I had attempted earlier, as revised.  This time, I entered them into Scheduled Tasks rather than into crontab, so I didn't need the * * * * * parts of the entries.  So here are the commands I entered in Scheduled Tasks:

/home/ray/bin/backup-hour.sh 2>> /Folder1/crontab-errors.log
/home/ray/bin/backup-day.sh 2>> /Folder1/crontab-errors.log

I didn't actually enter them both right away; I started with the first one, and made it run just once, at nine minutes past the hour (which was about two minutes ahead of when I was working on it).  When the time came, it ran, or it seemed to:  there was now a file named "crontab-errors.log" with 0 bytes in Folder1.  That was good enough for now.  I tried another line, this time telling Scheduled Tasks to make it an "X application" rather than "Default behavior."  That didn't seem to do anything, but whatever.  It looked I had what I needed, and I could add more knowledge later.