Microsoft Server

Report on BlueScreen (BSOD) events and stop codes with PowerShell

A PowerShell script to report on all BlueScreen events and stop codes from the Windows Event Log on a specific server can be a useful tool for system administrators to troubleshoot and prevent future system crashes. This script will query the System Event log for events related to bug checks (BlueScreens) on a local server or a remote server.
Note: I wrote this to check for one server at a time. If requested, or if I have a future need, I may adapt it to query a list of servers and have the output written to a log file.

Windows 10

Windows 10: Set search results default to detail view

For some reason Microsoft seems to think that “Content” view for search results is the best view. This goes for “generic” folders in general, but me for content view is a view that I’d rather see go completely from Windows. Unfortunately I for me there is no easy setting to change this. This means it’s time to dive into the Windows Registry a little and set everything to use Details view as default.

Folder views are user specific, local and are controlled by the Windows Shell. This means the registry keys can be found under:

HKCU\SOFTWARE\Classes\Local Setting\Software\Microsoft\Windows\Shell

Here you should remove the keys BagMRU and Bags. Once these two are removed, add the following key:

HKEY_CURRENT_USER\SOFTWARE\Classes\Local Settings\Software\Microsoft\Windows\Shell\Bags\AllFolders\Shell{7fde1a1e-8b31-49a5-93b8-6be14cfa4943}

Create 2 DWORD values with:

“LogicalViewMode”=dword:00000001
“Mode”=dword:00000004

Now log off and log back on and every window should be set to Detail view.

Dosbox

My Dosbox setup

I’ve been a big fan of Dosbox ever since I found out about it in 2004. Dosbox has been around since 2002, I just didn’t find out about it until later. At the time virtualisation was still in its infancy and virtualising MS-Dos to play old games on was not that easy and fairly memory intensive. Also Windows XP did not run most of the MS-Dos games I wanted to play. For a few years now I’m mainly using Dosbox-X or Dosbox-ECE as these bring more features than the standard Dosbox. My base configuration has not changed significantly over the last 10 years.

For my normal utilities I’ve added a line to the dosbox.conf which mounts a normal folder located on my physical machine. The path I use is normally c:\temp\dosbox\e and I’m mounting this with:

@mount e "C:\Temp\Dosbox\E"

The reason I’m mounting a folder instead of an image is that this way I can very easily add and remove software and have this available with just a quick reboot (CTRL-ALT-Home) of Dosbox. The standard folder structure within the mounted e-drive is:

The directories cd, floppy and hdd keep .img files for the respective formats. The dos directory keeps a full copy of MS-Dos 5.0 with various additional little utilities added from FreeDos. The reason it’s MS-Dos 5.0 is that Dosbox reports its version as being 5.0.
One of the extra little utilities that is not included in Dos version 5.0 is “choice.com”. This handy little utility wasn’t included until Dos version 6 and is still available in Windows 95/98. Choice.com is basically indispensable for creating interactive batch files. I’m using the FreeDos version which is called “choice.exe”.

The full autoexec part of the dosbox.conf is:

[autoexec]
@echo off
@mount e “C:\temp\Dosbox\E”
@e:
@path=z:\;e:\;e:\dos;e:\cd;e:\floppy;e:\hdd;

The reason I’m putting all these folders in the path is that I keep my batch-files with the images.

Games

Caesar IV – Runtime error on Windows 10

When trying to run the Steam version of Caesar IV on Windows 10, a runtime error will pop up and will close the game.

The Eventlog gives this:

Before immediately going for the refund, there are a few things that can be done to get this working. (this does not have to be done in this specific order, as long as it’s done before running the game again)

  1. In the folder “C:\Program Files (x86)\Steam\steamapps\common\Caesar 4\C4” right-click on the file: “RegisterDLL.bat” and select “Run as administrator”
  2. In the same folder, “C:\Program Files (x86)\Steam\steamapps\common\Caesar 4\C4” right-click on the file: “CaesarIV.exe”, click on Properties, there click on the “Compatibility” tab and select: “Run this program in compatibility mode for: Windows XP (Service Pack 2)” and “Run this program as administrator” and click the Apply button.

3. Download and install “DirectX End-User Runtimes (June 2010)” from the Microsoft page: https://www.microsoft.com/en-us/download/details.aspx?id=8109

The system does not have to be rebooted.

Note: This was tested on various versions of Windows 10 up to 20H2 fully patched until January 2021.
Updated on the 27th of January 2021

Microsoft Generic

216.146.35.35 & 216.146.36.36 added as primary to your DNS settings

With the update to their client version 5.3.1 for Windows, DynDNS sets the first to entries in your local DNS to 216.146.35.35 and 216.146.36.36. Unfortunately this causes the machine the DynDNS client is installed on to fail to contact any other server within the local network up to giving login issues over RDP if this server is domain joined and requires NLA. The reason is happens is that this update sets the option “Use Dyn Recursive DNS servers on this machine” default.
This can be disabled by opening the client, click Settings, click Preferences and uncheck “Use Dyn Recursive DNS servers on this machine”

Dyn Updater Preferences (not real IP nor account)

Once this option is unchecked, the client will stop hijacking DNS on the machine it’s installed on.

Windows 2000 Professional

Slipstreaming Service Pack 4 into Windows 2000

When installing Windows 2000 (and also Windows NT4 or Windows XP/2003 or even MS Office versions), it’s usually easier and less error-prone to install the OS with the latest service-pack or SP already slipstreamed into the installation media. Quite often this will resolve driver issues which may cause Blue Screens of Death during installation.
This guide assumes you already have a copy of the installation media and SP handy and further assumes you’re working on the D-drive. The mounted image or DVD drive is assumed to be the E-Drive. You can substitute the drive letters with whichever you’re using.

What do we need:
1) At least 1GB free space on the hard disk you’re working on
2) A CDR/CDRW drive to burn the CD or a USB Pendrive with sufficient capacity already made bootable before copying the slipstreamed image
3) A Windows 2000 installation disc or .iso image
4) A copy of Windows 2000 SP4 in the same language as the install media

From here I find it easiest to work with the command prompt. This is just a habit however and there is no real difference between working with the prompt or working with the GUI.

Mount the installation media and create a work-in-progress folder:
mkdir D:\Windows2000\i386
cd D:\Windows2000\i386

Copy the contents of the i386 directory of the installation media to the folder you just created with:
xcopy e:\i386 d:\Windows2000\i386 /e

The servicepack you downloaded, is usually an executable. You can extract this with typing the filename.exe -x, so in my case that is:
D:\SP4\w2ksp4_en.exe -x

You’ll get a popup box asking for the destination of the extracted files. I normally put these in the same directory, so I enter: D:\SP4 and click Ok.
Once this is completed, CD to the directory with the extracted files:
cd D:\SP4\i386\update

Now run the following command to update the Windows 2000 installation folder:
D:\SP4\i386\Update\Update.exe -s:D:\Windows2000
Note: There is a space between Update.exe and the -s switch, but there is no space between the -s and the destination. You don’t need to specify the i386 folder in the path here.

Once this has completed, copy the contents of the Windows2000\i386 directory to your bootable pendrive or burn it to CD/DVD.