Category Archives: Windows

Helpful Windows Admin Tips


To launch Windows Update from the Windows Run dialog:

ms-settings:windowsupdate


Use Powershell to kill processes with a name filter:

Get-Process | Where-Object {$_.Path -like "*SOME-FILTER*"} | Stop-Process


See what time computer was booted up:

net statistics server


Restart or Shut Down a Remote Computer and Document the Reason (https://technet.microsoft.com/en-us/library/cc770416(v=ws.11).aspx)

shutdown /i


 

Manually update Windows Defender to fix update failures KB2267602 (Definition 1.213.6196.0) – Error 0x80070643

On a few of my Windows 10 computers, Windows Defender was failing to update properly through Windows Update.  I found that you can manually update Windows Defender using this command from a terminal window:

I found this instruction in the comments of this post: https://answers.microsoft.com/en-us/protect/forum/protect_defender-protect_updating/definition-update-for-windows-defender-kb2267602/d0d06c7a-fd70-4f27-94a6-9320d8114768

Set Windows local user account passwords to never expire

I found this helpful instruction from @hansb1 to prevent Windows local user account passwords to never expire:

Open a Command Prompt as the administrator mode, then run the following command:


Your password will never expire.

Thanks @hansb1!

You can see his answer given in a comment to this Bleeping Computer post: https://www.bleepingcomputer.com/forums/t/565081/cannot-set-password-never-expires-server-2012/

Does Microsoft Visual FoxPro 9 run on Windows 10?

I’m sure many die-hard FoxPro developers are curious if Visual FoxPro 9.0 SP 2 will install and run on Windows 10. Well, I wanted to be one of the first to find out, just like I did back when Windows 8 was first released in its early preview.

So, let’s find out…

First, I installed Windows 10 Preview (64 bit) in a BootCamp partition on my 15” MacBook Pro. (Don’t worry about this Mac stuff, it’s still just Windows running on live hardware, just like if it were a Dell or HP computer).  That went very smoothly, and I did a full install, blowing away the Windows 8 playground I had been using  that partition, instead of updating it from Windows 8 to Windows 10.

Next, I gently inserted the Visual FoxPro 9 CD that I still have from circa 2004. First, it prompted me to install some “Prerequisites”, which it did with no problems. Next I moved on to the main VFP install, and I took all the defaults, then the CD spun around for a bit, and finally, it gave me a nice message screen stating “Setup is complete” and “There were no errors during setup.”  Looking good so far!!

image

Next, I downloaded and installed Service Pack 2 for VFP 9, and once again, got this nice little affirming message box:

image

Finally, I “installed” the VFP 9 Hotfix 3 for SP2 (i.e. copied the replacement files to the correct places per the instructions in the readme file in the zip download).

We now have a promising Microsoft Visual FoxPro 9.0 entry in the fancy new Windows 10 Start menu:

image

 

Yes, but does it actually run??

Now, I finally get to find out if we can run the fully patched Microsoft Visual FoxPro 9.0 SP2 Version 09.00.0000.7423 on Windows 10. So, I launch it from the Start menu, and quickly go the Help –> About screen:

image

One small issue with Task Pane…

If you launch VFP 9 it will initially show the the Task Pane, but you will get a small error in the view area of the Task Pane window. (Don’t worry, I’ll show you how to fix this below.)

Class definition MSXML2.DOMDOCUMENT.4.0 is not found.

2015-09-11_19-33-29

The issue is that Task Pane requires MSXML 4.0 Core Services. If it’s not already installed on your Windows 10 machine, you will get this error reported in the Task Pane app from the VFP IDE.

However, this problem is easily fixed… You need to download the MSXML 4.0 Core package from:  http://www.microsoft.com/downloads/details.aspx?FamilyID=3144b72b-b4f2-46da-b4b6-c5d7485f2b42&DisplayLang=en#filelist

Once, installed, now Task Pane will work properly:

2015-09-11_19-33-03

Now, let’s run some code…

Okay, it says the right version number all, but we need  run some FoxPro code to make sure this thing actually works…  So, I just downloaded the Thor Tool Manager for FoxPro from vfpx.codeplex.com, and ran Thor.app to put VFP 9 on Windows 10 to its first test. Thor uses tons of well-architected FoxPro code to do it’s magic, along with some UI forms, and it makes use of our beloved FoxPro cursors, so I figured this would be a good test.  I selected about 10 of my favorite VFPx tools from the Check For Updates form in Thor, and it nicely proceeded to download and install all the tools, and gave this confirming output for each one on the VFP desktop as it did its work:

image

I think we’re good folks!

Next, I ran a few of these tools, just to make sure they’d fire off, and they did. I’m pretty certain at this point, that my business apps would work just fine here, if I took the time to finish out this developer setup.

So, I haven’t done any real coding work in the IDE, and I probably won’t any time soon, but from my basic tests in this experiment, it sure appears to me that our old friend Visual FoxPro is ready to continue its legacy of being an awesome development tool, even on Windows 10, and hopefully on Windows 20 and Windows 30 as well.

Finally, here’s a  peak at the whole IDE running in Windows 10. You can see I docked some windows, and you can see the shading effect that Windows 10 adds around the individual windows.

image

Installing COMCTL32.OCX and MSCOMCTL.OCX on a Windows XP Machine

I recently had to install the Microsoft Common Controls on an XP machine that had never had this stuff installed before… Probably these files were missing because this machine had never had Microsoft Office, or VB, or Visual Studio, or whatever suite installs these items.

I needed these files to run a FoxPro app that I had written which used the TreeView control from the VB6/MSCOMCTL.OCX library.

Here is what I learned and how I got it working:

Getting started

 Note: There are TWO Common Control libraries out there. You must figure out which one you need.

1. The older VB 5 Common Controls (COMTL32.OCX)

     and

2. The newer VB6 Common Controls (MSCOMCTL.OCX):

Regarding the older COMCTL32.OCX (VB5 era) versus the newer MSCOMCTL.OCX from VB6 era, one user on StackOverflow had this to say:

“The earlier Common Controls 5.0 (comctl32.ocx) has better compatibility with XP/Vista than the Common Controls 6.0 (mscomctl.ocx). I suggest using it instead” – rpetrich Aug 13 ’09 at 0:44

Step 0: Before installing either of the Microsoft Common Controls you must have the following versions of the Automation system files on your system:

OLEAUT32.DLL     2.20.4054 or greater
COMCAT.DLL        4.71 or greater
OLEPRO32.DLL    5.00.4055 or greater
ASYCFILT.DLL    2.20.4056 or greater
STDOLE2.TLB        2.20.4054 or greater

You may or may not have these files on your system already. I really don’t know how these files generally get installed on a new system; if they are part of the main OS install, or if they get installed with other common Microsoft suites. My guess is that if you have Office 97, Visual Basic 5.0, Visual Studio, Internet Explorer, or Visual C++, etc, you should already have these Automation system files.

Either way, if you do not have these files on your system, you must first download and install them as documented in the following Microsoft Knowledge Base article:

Download here: http://support.microsoft.com/kb/180071/EN-US
(Default download filename will be named Msvbvm50.exe)

1. For the older VB 5 Common Controls (COMTL32.OCX):

Follow Step 0 above.
   
Once you are sure you have the correct Automation system files on your computer, you can install COMCTL32.OCX by executing COMCTL32.EXE. This will install the following files:

COMCTL32.OCX    5.00.3828    Updated ActiveX control
COMCTL32.DEP    5.00.3828    Dependency info for Visual Basic 5.0 Setup Wizard
MSSTKPRP.DL      5.00.3714    Design-Time Stock Property Pages

The setup program does not install a *license* to use COMCTL32.OCX for development. You must already have a license installed on your system by one of the products listed in the applies to section above in order to COMCTL32.OCX for development.

Download the COMCTL32 install package here:
http://download.microsoft.com/download/win95upg/update/1/w97/en-us/comctlzp.exe

The default download filename will be comctlzp.exe.
Note: You must then unzip this exe to get the actual installable exe file.
  

2. For the newer VB6 Common Controls (MSCOMCTL.OCX):

Follow Step 0 above.

As far I could determine, there is no official download link from Microsoft for MSCOMCTL.OCX. You can find tons of free download links all over the internet, but those sites always scare me as they might contain viruses or malware.

I learned a lot about the issues around getting the files downloaded and installed here:
http://stackoverflow.com/questions/1226319/whats-the-proper-source-for-windows-common-controls-6-0-component-mscomctl-ocx
   
So, based on the info on the above post, here is what I did:

  1. Locate this file (MSCOMCTL.OCX) on some other XP machine that already has the file. Path is C:\Windows\System 32.
  2. Copy this file to the same path C:\WINDOWS\SYSTEM32 on the new machine.
  3. Register the file by running ‘regsvr32 C:\WINDOWS\SYSTEM32\MSCOMCTL.OCX’ at the command window. (Admin right are probably required.)
  4. Reboot.

   
   

If you have any corrections or additional instructions to share, please add a comment so we can get this reference as correct as possible.