Using the SFC (System File Checker) and DISM (Deployment Image Servicing and Management) Tools to repair Windows

SFC ( System File Checker)

One way to ensure you Windows files are not missing or corrupted is using a Microsoft tool called SFC ( System File Checker).

Simply open Command Prompt (run as administrator) then type the following command:

sfc /scannow

DISM (Deployment Image Servicing and Management)

DISM (Deployment Image Servicing and Management) is used for creating Windows images for deployment. Next you can use DISM to essentially check and repair Windows using Windows Update. It can also fix update failures. Simply run the this command next:

dism /online /cleanup-image /restorehealth

Links & References

Generate a QR Code using Python

If you’re a newb like me and you want to learn Python (or any programming language) you start off with learning little things like this.

What you’ll need first

Open up Visual Studio Code and select the language, which should be asking you on line 1. After you can go ahead save the file as a start to your desktop. I saved it as QR Code Generator.py

Visual Studio Code may offer to download the relevant software, so I’d click yes to that. I did however make sure to PIP (pip is the package installer for Python) was installed after by going to command prompt and typing "pip help" which if you get a response and not an error message then all is well. Also using pip install the module PyQRCode, which is what we’ll use "pip install pyqrcode".

The code

import pyqrcode
from pyqrcode import QRCode

s = "https://savas.co.uk/"

url = pyqrcode.create(s)

url.svg("qr.svg", scale = 8)

The first two lines are importing the module to work with/from. The next line is establishing what “s” string represents. After that you can see we’re bringing the ‘s’ string, which is the actual URL and using “pyqrcode” (from the module) to generate the QR code. The last line is how the QR code will be generated/outputted. In this case as a .svg file, with the size 8.

This should save to the location the file is saved at, so in my case the desktop. If you decide to save it as a .PNG file, then you’ll also need the pypng module.

Links & References

How To Install PIP to Manage Python Packages On Windows
https://phoenixnap.com/kb/install-pip-windows

SearchMyFiles Context Menu addition (for when right clicking within a folder)

As of version 3.16 of SearchMyFiles you can go to Options menu and click the option “Explorer Context Menu” which should add a context menu option to search within for when you right click on a folder.

This is just short of having it easy access, because usually I find myself already in the folder and it is a bit tedious going up and right clicking on the folder that I’d like searched.

Best option here is to add an additional context menu to appear when you just right click while you’re already in there. To do this you’ll need to edit your registry editor, or you can create a regedit script to add it automatically.

Automatic

Download and save this to your desktop:

https://share.savas.co.uk/zexO4/qEyoRIJo48.reg/raw

Run the script, which should automatically create the below registry lines for you.

Manually

Press start and type regedit.msc and hit enter. The Registry Editor should open.

Select all on the address bar, then paste:

Computer\HKEY_CLASSES_ROOT\Directory\Background\shell

On the left folder tree, right click on shell and create “Search Here (SearchMyFiles)” key. On the right side, create a string called “Icon” and set the value data to:

"C:\Program Files (x86)\NirSoft\SearchMyFiles\SearchMyFiles.exe",0

Now right click on the key “Search Here (SearchMyFiles)” you just created and add another key call it “command“. At this point it should look like this:

Now finally, within “command”, edit the default string and set the value data to:

"C:\Program Files (x86)\NirSoft\SearchMyFiles\SearchMyFiles.exe" /SingleBaseFolder "%V"

Should look like this:

You’re done!

What is SearchMyFiles

SearchMyFiles is a nice tool to search in a folder for a specific text, binary or even wildcard. Lets say you have an unorganized list of contact numbers, you’re not sure where the number for a certain person is saved and you have 100’s of sheets or documents. Using SearchMyFiles, you can basically narrow it down if you know the persons name or any string that you can match the result to.

Alternative to Windows Search For Files + Duplicates Search
https://www.nirsoft.net/utils/search_my_files.html#DownloadLinks

Removing/Uninstalling Microsoft Store packages via PowerShell

I accidently started Microsoft Photos and it suddenly decided to download and install Photos Media Engine Add-on in the background. Very odd.

Don’t get me wrong Photos a nice application for looking at your pictures, but I don’t use it and I prefer digiKam for viewing my albums if anything. Also JPEGView is much more powerful when viewing individual images.

Anyway, what convinced me to remove it entirely is constantly switching my defaults and now oddly installing the add-on in the background. Especially one that seems to share possible personal pictures over to the internet without consent, but this is just speculation.

Either way, to remove it you can simply go to Settings > Apps, then find Microsoft Photos and click on advanced options to remove it. If that’s not doing the trick, I prefer PowerShell.

Removing packages using PowerShell

Start PowerShell by right clicking on the Start icon on your taskbar. Click PowerShell (Admin) and type the following cmdlet.

get-appxpackage *Microsoft.Windows.Photos* | remove-appxpackage

You can also remove other Microsoft Store Apps this way. For example type the command below which will list all the apps installed:

get-appxpackage

Can also narrow it down to certain keywords, such as all the apps that contain “gaming” within the Name field:

get-appxpackage *gaming*

Then copy the “Name” field exactly as written and replace Microsoft.Windows.Photos from the above example. Making sure to include the *’s.

Removing Xbox/Microsoft Gaming packages

Like mentioned above, if you search *gaming* or *xbox* you’ll find some bloatware that you can remove. I like to remove these.

get-appxpackage *Microsoft.GamingServices* | remove-appxpackage
get-appxpackage *Microsoft.GamingApp* | remove-appxpackage

Removing People Bar feature packages

get-appxpackage *Microsoft.People* | remove-appxpackage
get-appxpackage *Microsoft.Windows.PeopleExperienceHost* | remove-appxpackage

Removing Windows Search package

If like me, you use an alternative search software (Everything by voidtools) you may want to get rid of the Window Search features just to avoid wasting resources and indexing. There is more to it than this so I suggest looking into how to completely turn off indexing also as I did all of that before running this cmdlet so I cannot confirm if this does all of that just yet.

get-appxpackage *Microsoft.Windows.Search* | remove-appxpackage

If you get any permission errors

If you get a 0x80073CFA error and a message saying “This app is part of Windows and cannot be uninstalled on a per-user basis…” well you can stop there as these apps may genuinely be integrated enough to cause issues if you uninstall or you can bypass it and remove it or you can look at other ways, such as using Group Policy to disable or turn them off. These blocks were introduced by Microsoft’s recent Windows 10 updates. See links below for links (some methods may be out of date).

Windows App Cert Kit

If you go to start, and type and run ‘Windows App Cert Kit’ you are able to validate every app installed, sometimes this is useful to also see what apps are actually installed in a more visual way.

Links & References

PowerToys – PowerRename

Have you ever needed to rename or modify a large number of files, say even change the dating format? I have. I used to create a batch file for this, which was a little tricky and sometimes would lead to mistakes. To avoid that, you can use PowerToys, PowerRename utility.

After you install PowerToys, you’ll automatically see the context menu PowerRename after right clicking files in a folder.

What I wanted to further add is there are more than just renaming files as per the GUI. Using the link below, look under Examples of regular expressions and you’ll find various ways you can add text to the start, end or in-between certain text strings.

PowerToys PowerRename utility for Windows | Microsoft Docs
https://docs.microsoft.com/en-us/windows/powertoys/powerrename#examples-of-regular-expressions

For example I started working on a project that I created various documents, after I noticed I needed to title the documents based on sections, however I had something like twenty files to rename. I needed to add a keyword just before the main title of the file name. Using the ^ expression, I avoided renaming twenty or so files. There is plenty more useful strings/expressions if needed.

Windows Audit Mode, Out-Of-Box Experience (OOBE)

So you have a system that you would like to reformat and install a fresh version of Windows 10/11, but it’s for someone else and you would like them to create the first user. That’s where Windows Audit Mode comes in handy.

Basically you are able to pause the personalization of the installation and get right to the desktop to do whatever you want, such as updating, activating and installing specific programs, say for example an office suite.

How?

Using your usual method of freshly installing Windows, just as it asks you to setup the system (exactly on region selection step) press CTRL+SHIFT+F3 and it should boot directly to desktop. It should also add a dialog box to allow you to select to shutdown once you’re all done.

This method is also part of the way of creating a Windows image that can be used to install on multiple machines, but that warrants a different post.

References:

Boot Windows to Audit Mode or OOBE | Microsoft Docs
https://docs.microsoft.com/en-us/windows-hardware/manufacture/desktop/boot-windows-to-audit-mode-or-oobe?view=windows-11

Customize Windows in Audit Mode | Microsoft Docs
https://docs.microsoft.com/en-us/previous-versions/windows/it-pro/windows-7/dd799305(v=ws.10)?redirectedfrom=MSDN

Disable Microsoft Defender Antivirus real-time protection permanently

First disable Tamper Protection in the Microsoft Defender settings itself. Then using Windows Powershell (admin) disable the real-time protection with the below cmdlet.

Set-MpPreference -DisableRealtimeMonitoring $true

Alternative method is using the Group Policy Editor.

Turning off real-time protection permanently even after restarting.

OPTION FIVETurn On or Off Real-time Protection for Microsoft Defender Antivirus | Tutorials
https://www.tenforums.com/tutorials/3569-turn-off-real-time-protection-microsoft-defender-antivirus.html

This link should also provide you with other useful things to switch off/on. Like disabling telemetry.

Microsoft has slightly changed some things so they may be worded differently. Such as Windows Defender is now called Microsoft Defender so older guides may not reflect that. Tamper protection needs to be also disabled.

Links & References

Accessing Local Group Policy Editor and Local Security Policy for Windows 10 Home editions

Simply to upsell Microsoft feels the need to basically switch off components within its Windows OS (Operating System). Annoyingly the real-time protection feature keeps enabling itself every time Windows is restarted. You have a few ways to switch this off, but my personal preference has always been the group policy method, however using Home editions this is missing.

You can use this method to enable it:

Local Group Policy Editor

How to Enable the Group Policy Editor on Windows Home Editions | TechSpot
https://www.techspot.com/guides/1719-group-policy-editor-windows-home/

Or slightly different way:

How to Access the Group Policy Editor in Windows Home
https://www.makeuseof.com/tag/access-group-policy-editor-even-windows-home-settings-try/

Local Security Policy

How to Enable Local Security Policy (secpol.msc) in Windows 10 Home – MajorGeeks
https://www.majorgeeks.com/content/page/how_to_enable_local_security_policy_in_windows_10_home.html

Simply right click on the start button (bottom left) and launch ‘Run’ then type:

%SystemRoot%/System32/secpol.msc

Alternatively simply search in the Start menu for secpol.msc and that should give the best result as the Local Security Policy.

There does seem to be an alternative method to Group Policy called Policy Plus, but I have not tried it out completely to comment. You can find it linked below.

GitHub – Fleex255/PolicyPlus: Local Group Policy Editor plus more, for all Windows editions
https://github.com/Fleex255/PolicyPlus

Sav’s guide to USB flash memory & Micro SD card testing

You just bought a new USB flash drive or Micro SD card, nice! But is it fake? Does it meet the advertised capacity and speeds? These things should be tested right away, giving you enough time to go back to where you bought it from if needed.

One of the most important things is how fast is the read and write speed of the port you’re using to test the drive. If you’re testing out an SD card, make sure the reader/writer is capable of going beyond the speeds the card is capable of.

If you’re unsure, just be aware that if your tests reach this number constantly then maybe it is your port and not the SD card. Assuming you’re not sure of the capable maximum speed, lets start off with:

CrystalDiskMark

Most cases drives come already formatted, so before making any changes, doing a quick test with CrystalDiskMark allows you to assess if your port that you’ve connected to is holding you back. Use another drive to compare it to.

I recommend making a folder on your desktop, with the folders nicely named of each drive you’re testing.

If you do not have a spare drive or SD card to compare to, then just be aware that if you just purchased a drive that claims to read and write 100MB/s and you’re only getting 30MB/s well that may be the maximum the port can go. You may need to try another device as an alternative method. This doesn’t mean it can’t possibly be that bad. It actually can, but this is all about getting a baseline for your tests.

Disk Management

See what you’re dealing with. Press Start (Windows 10) and run “diskmgmt.msc”, this will open up Disk Management and will show you what the partitions look like on the drive. If there’s two partitions, with one being very small I wouldn’t touch it for now, but simply make a mental note. You’ll start to get a better understanding of the drive as you go.

H2testw

Once you’ve done a baseline and checked the size, the main thing to do is a data integrity test. This will save you the bother of continuing if the size (capacity) is false. It will also give you a average read and write speed, but this test is the longest.

If H2testw managed to successfully write every byte on the disk without issue then the capacity is real. It should have also given you a average write & verify (read) speed result while it was doing the test. Take screenshots and move onto the next steps.

SD Card Formatter

If you’re using an SD card, it’s definitely worth formatting using the SD Card Formatter tool from SD Association website. If the drive needs a format, this is reliable way to do it. I also like to run diskpart and clean the drive before doing a format.

diskpart

Press Start (Windows 10) and type cmd which should result to Command Prompt. Right click and run as an administrator. Step 1) Type “diskpart” in the terminal and it should run. I’ll be basic with the instructions on this, but I recommend looking at a few YouTube videos of this command line tool if this is the first time you’re using it. Any wrong move and you might format important drives.

Step 2) list disk

You’ll get a nice list of all the disks connected to the system. Look for the one that is your drive you’re dealing with. Usually you can tell as it’s the last connected drive and matches the capacity.

Step 3) “select disk x(where x is your USB key)

Step 4) “clean”

HD Tune Pro

This program basically does what CrystalDiskMark does but gives some more information. I like to do a read/write tests without the drive being mounted (first tab). Take screenshots of both the read and write test.

Format the drive using SD Card Formatter / diskpart / Disk Management console.

If you’re formatting an SD card; use SD Card Formatter above. If it’s a normal disk or USB drive, you can use Disk Management to create preferred partitions or use diskpart again, repeat the steps above, but continue below.

Step 5) “create part primary”

Step 6) “select part 1”

step 7) “active”

Miscellaneous

Storage manufactures are basically falsely advertising by using a different form of measurement of bytes thus resulting in different outcome for what is the true capacity of the drive. To be as simple as possible. 1 GB to them is 0.9313 GB.

So an advertised 1TB would be 931.32GB on your computer as available storage. If you’re getting even less than this then the capacity is basically missing.

Here’s some useful information:

Why a hard drive has less storage space than promised?
https://www.tweakandtrick.com/2013/07/lost-storage-space.html

Convert byte to gigabyte – Conversion of Measurement Units
https://www.convertunits.com/from/byte/to/gigabyte

SSD is 256 gb but only showing 238 gb? | Tom’s Hardware Forum
https://forums.tomshardware.com/threads/ssd-is-256-gb-but-only-showing-238-gb.1998324/

Summary

Using various software and tools mentioned above you can collect enough results to determine the true capacity and speed. There are more tools. There is more things to know, but for now this is it.

How to download the latest Windows 11 (any version) directly from Microsoft

It’s always best to make sure you’re downloading a legit and untampered version of your operating system you want to use. Here’s a simple three step guide to download a copy of Windows 11 directly from the Microsoft website.

Step 1) Go to: https://www.microsoft.com/en-us/software-download/windows11

Step 2) Scroll down till you Download Windows 11 Disk Image (ISO), select your language, it should then simply generate you a download link that lasts for 24 hours.

Now, you could just load that onto a USB and be on your way (using rufus to create a bootable USB drive), but maybe you want to actually verify what you’ve downloaded? Here’s how:

Download IgorWare Hasher, which basically verifies the files SHA-1, MD5 and CRC32 hashes. Using that you compare it to a known list of verified ISO’s. This time Microsoft provides these hashes right after selecting your preferred language.

Oh and for your information, “English International” is the British English version, supposedly.

See also

https://www.microsoft.com/en-us/windows/windows-11-specifications