Windows 7 Boot Sector Repair

The Scenario

I was working on a dual booted MBR style disk which had Windows 7 and Ubuntu installed. I was asked to remove the Ubuntu partition(s) and extend the Windows partition. The user had a backup of all data from the Ubuntu partition, not the Windows. The GRUB boot loader was in operation.

The Solution

I began by backing up the disk.

I then booted into Windows and inspected the disk partitions via Disk Manager and (thankfully) found that Windows had been installed first, shrunk and then Ubuntu installed. This was apparent by seeing the order of partitions on the disk from left to right. I then deleted the 2 Ubuntu related partitions at the end of the disk (both were present after the Windows OS partition) and extended the Windows partition into the recovered space.

Then I rebooted into a Windows Recovery environment via a USB install I’d been supplied with and let Windows attempt a start-up repair, that failed and no valid Windows partitions were displayed, which might be normal if GRUB is controlling the bootloader but I’d have expected Windows PreInstalled Environment to detect the local partition.

I then opened a command prompt and ran the following commands:

bootrec /fixboot

-This ran successfully

bootrec /fixmbr

-This failed to complete, unable to find device or somesuch

bootrec /rebuildbcd

-This failed, it was unable to write to device

I spent a good hour attempting to manually rebuild the bootloader via bcdedit commands which eventually failed until I came across a thread suggesting the issue is booting from Windows 7 USB media.

I then dug out an old Windows 7 DVD and booted from that and voila, the above commands worked successfully. I did have to trash c:\boot\BCD via the commands:

attrib c:\boot\bcd -s -h
move c:\boot\bcd bcd.old

and then set the OS partition (no 100MB System partition on this disk) to active before running them successfully. I also then launched the Windows Startup Repair from within the DVD repair tools to correct any faults with active partitions etc. Following that the system booted.

Hope this helps someone, what should have take 15 mins ended up taking me 2 hours!

Intel Network ProSet Fails to Uninstall

I recently struggled to upgrade my Intel(R) Network Connections driver installation from v22.4.10 (unsupported in Windows 10 1703) due to a corrupted uninstaller.

Symptoms:

When attempting to install the latest supported driver (v22.6.6.0) the installer attempts to call any currently installed versions’ uninstaller and then fails with error 1703.

Resolution:

After much reading up I came across this post from days gone by referring the the last nuclear approach of MZIZAP https://blogs.msdn.microsoft.com/ronalg/2012/06/07/troubleshooting-msi-uninstall-issuesintel-pro-network-connections-1713/ .
That led me to search for modern alternatives which led me to the Windows 10 Helper utility https://support.microsoft.com/en-gb/help/17588/fix-problems-that-block-programs-from-being-installed-or-removed

Launching that and first running it to repair the uninstaller and then again to forcibly remove it did the trick, I was then able to install the latest version.

 

I hope this helps someone else.

Subinacl.exe Microsoft Service Permissions

A nice little tool to manage service permissions on Windows name subinacl is available at https://www.microsoft.com/en-gb/download/details.aspx?id=23510

Default install directory is “C:\Program Files (x86)\Windows Resource Kits\Tools”
Usage example for the ‘spooler’ service and the user domain\username:

subinacl /service spooler /grant=domain\username=top

 

 

xcopy /C/H/R/S/Y c:\ d:\

/C = Continues copying even if errors occur
/H = Copies hidden and system files also
/R = Overwrites read-only files
/S = Copies directories and subdirectories
/Y = Overwrites existing files without asking

 

robocopy c:\ d:\ /MIR /R:0 /W:0

/MIR = Mirror entire directory structure (can use /E instead)
/R:0 = 0 retries for read/write failures
/W:0 = 0 seconds between retries

Credit to: https://djlab.com/2010/12/windows-ignore-errors-with-xcopy-and-robocopy/

Microsoft WSUS Rebuild

To re-install WSUS with a clean database i.e. no previous configuration:

Run Windows Powershell as Administrator and use the following commands:

  • Uninstall-WindowsFeature -Name UpdateServices,Windows-Internal-Database -Restart

 

  • Post restart, delete EVERYTHING in the C:\Windows\WID\ (for Win 2012 r2) folder.

 

  • Then run the following command to re-install WSUS:
    Install-WindowsFeature UpdateServices -Restart

 

This only works on PowerShell 3 or higher.

 

UPDATE
I had to run the postinstallation tasks manually via Powershell using the WID db, if using SQL you need to add in sql_instance=

C:\Program Files\Update Services\Tools\WsusUtil.exe content_dir=”<<dir of update download location>>

 

creds: https://serverfault.com/questions/449914/how-to-completely-wipe-wsus-and-start-again

Windows 10 Disable Cortana

Either through GPO :

Computer Configuration > Administrative Templates > Windows Components > Search

Allow Cortana = DISABLED

 

Or via the registry directly (always backup first – http://www.davegernon.co.uk/techblog/export-windows-registry/)

HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows Search

Create a DWORD-32Bit Value named and value:

AllowCortana=0

Windows Software Won’t Uninstall – Reboot Required Despite Rebooting

If this problem happens then it may be a result of failing pending changes to the Windows OS. These file changes are listed in a registry key:

HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Session Manager\

under DWORD:

PendingFileRenameOperation

I would suggest first renaming this DWORD value, with the prefix “OLD_” or something similar and then attempting the un/install again.

If there were some unexpected results in renaming the file it is trivial to remove the prefix and restore the system but best practice would include an entire registry export prior to fiddling!

Export Windows Registry

 

Group Policy Management – Outlook 2016 Policy GUI Bug

After a little puzzling with MS Outlook 2016 Synchronization settings GPO I thought I’d share this small bug in the GUI (at least for our environment 2k8r2 ADs):

 

If you’re editing Outlook 2016 cached exchange mode duration:

 

\User Configuration\Policies\Administrative Templates\Microsoft Outlook 2016\Account Settings\Exchange\Cached Exchange Mode\Cached Exchange Mode Sync Settings

 

Then switching the option to “All” and re-opening the policy in the GUI will display it reverting to “Three Days”, this is a bug!

 

My solution was simply changing the setting to “All” and not returning to the GUI control of the policy, if I then exited the policy and returned to the Group Policy Management GUI, inspecting the policy’s [Settings] I found the “All” setting was retained behind the scenes.

Windows 10 Reboot Loop : Startup Repair

I came across an HP unibody laptop which was caught in a Windows 10 reboot recovery startup loop. Unable to complete an SFC scan I discovered a DISM command which will trash any pending disk actions and in this case allowed the system to boot to the login prompt (after throwing away a number of Windows updates).

 

dism.exe /image:C:\ /cleanup-image /revertpendingactions

How to Fix SFC /SCANNOW There is a System Repair Pending