windows

Is Active
On

Python's Sendmail fails due to access permissions

A script that ran happily for about a year suddenly stopped working last week. From the stack trace, it was apparent that the script was stumbling on Python's smtplib>sendmail command. Here's the error: OSError: [WinError 10013] An attempt was made to access a socket in a way forbidden by its access permissions The offending code: s = smtplib.SMTP(config['smtpserver']['server']) s.sendmail(fromAddress, toAddress, msg.as_string()) The best suggestion I found is that Windows UAC is likely preventing the successful sendmail[^1].

Toggling a Network Adapter with Python 3

if you frequently have to toggle between two network adapters in Windows, it can become a hassle to keep opening the Control Panel widget, right-click, disable/enable adapter, etc. For example, you may want to turn off your wired connection and connect to wifi, then switch back to wired, etc. With Python and this 'admin' library (also attached to this post for download), you can just place a shortcut on the desktop and double-click to enable/disable a particular adapter.

Collecting new document files for easy attachment in email

I find that I frequently (many times daily) have to send files as email attachments. Depending on the task, the files can be located in a half-dozen or so places on the Windows file system. I found myself browsing (from Outlook's "Attach File" function) to my Documents, Downloads, Desktop, or one of several network drives for the file I just saved there a few seconds ago. I had the idea that those folders could all be monitored, with copies of the most recent files from each kept in a single place.

Upgrading from PHP 5.5 to PHP 7.1.1 on Windows IIS Server

I recently had to upgrade a Windows IIS Server running PHP 5.5 to PHP 7.1.1. I ran across this excellent blog post which got me 99% of the way through the process. Some things I had to do additionally/differently: Because mine was an upgrade, and not a fresh installation of PHP, I had to remove old "Handler Mappings" that tried to point to the old PHP5.3 directory/executable. I had to do this (remove old PHP mapptings) a second time, on the individual 'site' in the IIS Manager on the server. It wasn't enough to to it at the IIS Server level.

AHK - Autoload multiple scripts with separate autoexec and timer hooks

This post outlines a method I came up with to use a single AutoHotKey script to auto-load any number of scripts in a sub-folder. It also allows every script to have its own autoexec section, and to hook into a timer for event-type functionality. AutoHotKey scripts that are 'persistent' need to be loaded into memory by Windows just one time. If you have several of them to load, you can get them all individually, but you end up with a system tray full of little green 'H' icons.

Organizing Windows on the Desktop and Connecting to Network Drives with AutoHotKey

AutoHotKey is a powerful Windows automation tool, capable of doing pretty much anything you could do yourself on your PC. I have a number of scripts I run regularly (or always have running) to speed up my work and/or make it more accurate and efficient. One of my favorite scripts responds to the key combination of Ctrl-Alt-0 (that's a zero). When I press that combo, a couple things happen: 1) First, the script checks to see if the machine is connected to WiFi, and if so, grabs the name of the WiFi's SSID.

Mapping Network Drives at Multiple Locations

Background Network drives allow multiple users on the same network to have acccess to the shared folders/files. However, if you have two different sets of network drives (at work and at home, for example), it can be a hassle to manually map drives when your computer 'resumes' on the new network. For example, if I'm at work, all my network drives are available. When I go home and connect to the local network, my work network drives disappear (that's fine, they're not available anyway) but my home network drives don't automatically map. The same is true when going from 'home' back to 'work'.

Slow Bitlocker Encryption?

I recently had a need to turn on Bitlocker encryption (in Windows 8.1) for a 1.8 TB external hard drive. After three workdays (more than 24 hours), the drive was claiming it was only 5.2% completed with the encryption step. I searched all over and didn't find an answer, but a colleague recommended plugging the usb drive into a USB 3.0 compliant port, vs. a USB 2.0 port. I had that option available on my machine, and as I'm writing this (about three hours later), the drive is about 67% encrypted. It's working! 

Tags

Installing Autohotkey on Windows 8.1

When I tried to install Autohotkey 1.1.20.1 recently on a Windows 8.1 64bit machine, the installer failed. It 'ran' ok, but on the installer splash screen, none of the buttons or links would 'do' anything. I tried the "Express Installation" and "Custom Installation" buttons and the "Read license" and "Extract to..." links. I tried running the installer as an Administrator.