# The Wiert Corner – irregular stream of stuff

• ## Email Subscription

Join 1,721 other followers

# Archive for the ‘Windows 8’ Category

## Reducing the size of your Windows.edb (Search) and DataStore.edb (Update) databases

Posted by jpluimers on 2017/01/30

### Windows Search: Windows.edb

If you use Windows Search (I don’t: I use Everything by VoidTools), your Windows.edb can grow ridiculously large. It is a single file, though it appears to be in two places because there is a symbolic link from C:\Users\All Users to C:\ProgramData :

C:\ProgramData\Microsoft\Search\Data\Applications\Windows\Windows.edb C:\Users\All Users\Microsoft\Search\Data\Applications\Windows\Windows.edb 

This is how to reduce its size:

#### How to offline defrag the index

1. Change the Windows Search service so that it does not automatically start. To do this, run the following command in cmd.exe:
sc config wsearch start=disabled
2. Run the following command to stop the Windows Search service:
net stop wsearch
3. Run the following command to perform offline compaction of the Windows.edb file:
esentutl.exe /d %AllUsersProfile%\Microsoft\Search\Data\Applications\Windows\Windows.edb
4. Run the following command to change the Windows Search service to delayed start:
sc config wsearch start=delayed-auto
5. Run the following command to start the service:
net start wsearch

Notes:

1. I did not perform the last 2 steps as I’ve kept Windows Search disabled.
2. If you want to reduce the size of the C:\ProgramData\Microsoft\Search\Data\Applications\Windows\Projects\SystemIndex\Indexer\CiFiles\ directory:
1. Before step 1, choose what kind of Windows Search indexing options you want
2. Between step 3 and 4, delete the directory

### Windows Update: DataStore.edb

Windows Update uses the same database structure and is a single file:

C:\Windows\SoftwareDistribution\DataStore\DataStore.edb

This is how I reduced its size:

net stop wuauserv
net stop bits
esentutl.exe /d C:\Windows\SoftwareDistribution\DataStore\DataStore.edb
net start bits
net start wuauserv


Talking about Windows Update: you might also want to Clean Up the WinSxS Folder

–jeroen

## Some notes on my Windows 10 upgrade processes

Posted by jpluimers on 2016/12/26

Shortly before the “Free Windows 10 Update” deadline I upgraded a bunch of physical and virtual machines each with different configurations providing various challenges.

Back then, I didn’t have time to properly write down notes so I saved a bunch of links. Now I found time to add a few notes below.

### Windows Editions

Note there are fewer Windows 10 editions (Home/Pro/Enterprise) are different than before so there is a mapping (for instance Windows Ultimate does not map to Windows Enterprise): Windows 10 free upgrade matrix.

### Getting the Windows 10 ISO image

It’s much easier, faster and disk-space friendly to install from ISO than waiting for GWX.exe or GWXUI.exe, especially when installing multiple systems in a row.

I don’t use x86 systems any more so I used Win10_1511_2_English_x64.iso which is slightly newer than Win10_1511_1_English_x64.iso and is likely to be outdated by now so get yours through https://www.microsoft.com/software-download/windows10.

If you insist, there is Win10_1511_2_English_x32.iso (note the x64 -> x32 consistency, many people refer to it as x86 though).

### Mounting ISO images

Windows 10 does not like to upgrade when you have the Daemon Tools ISO mounting tool installed. But Portable WinCDEmu is fine.

The Windows 10 installer doesn’t suffer from Portable WinCDEmu not mounting after reboot: during the first install step it copies enough to continue without the ISO image mounted after reboot.

### Installing using (Virtual) CD drive

Just run the SETUP.EXE in the root of the CD drive.

### Creating bootable media

Some systems do not have optical media any more so you need to create bootable media.

In the past, you used ImageX for that (e.g. Step-by-Step: Basic Windows 7 Deployment for IT Professionals), but as of Windows 8/Server 2008 R2 there is DISM: Apply Images Using DISM.

I used this command-line to copy from H: (the content of the ISO image) to V: (the VHD drive):

dism /apply-image /imagefile:H:\Sources\install.wim /index:1 /ApplyDir:V:\

More information at DISM Image Management Command-Line Options and DISM.exe Replaces ImageX.exe – My Thoughts On IT… (you can even use it to backup/restore file-based Windows images).

### Multi-boot / boot configuration data

In the past (think Windows XP and earlier), you had BOOT.INI to choose which one to boot. Now there are msconfig and Boot Configuration Data editors like bcdedit and bcdboot for that:

### Installing on VHD

You cannot update Windows 10 on a “Boot to VHD” based system: it’s one of the limitations in What is not supported for native boot when using VHDs:

• Upgrading the operating system booted from a VHD. If you boot from a VHD, you cannot upgrade the Windows version in the VHD to a newer version.

There is a cumbersome workaround using Hyper-V which I didn’t use (look for “How do I install the November Update if Windows 10 is running on a VHD using native boot?” in Hands-on with Windows 10: Upgrading, installing and activating in the real world | ZDNet).

These are the steps I used to get it on a VHD (based on the How to install Windows 10 to VHD and create a dual boot system with Win 7/8 video below):

2. Mount the ISO
3. Create a VHD using Disk Management (diskmgmt.msc)
1. Ensure 20 gigabytes or larger (I used a pre-allocated disk)
2. Name it appropriately (note the name)
3. Initialise it using MBR
4. Create a new “Simple Volume” formatted as NTFS
5. Mount it (I used V: drive)
4. Start a command prompt (cmd.exe) as Administrator and confirm the UAC prompt
1. Image the ISO to the VHD using DISM (see command-line above)
2. Add the VHD (drive V:) to the boot list: bcdboot V:\Windows
5. Using MSCONFIG ensure the Windows 10 VHD boots as default (it will reboot at least once during installation)
6. Complete the Windows 10 Installation
1. Enter the key used for the original Windows system or a new Windows 10 ke
7. Optionally Using MSCONFIG ensure the original Windows 10 VHD boots as default (it will reboot at least once during installation)

You can use an existing VHD for DISM in which case you might need to Resize/extend virtual hard disk to get more space under Windows 7/8/10.

### Key validation issues

If you get an error 0x80041023 during key validation at install time, then retry it later. Often the validation then just works. If it doesn’t, try to Activate Your Windows 10 License via Microsoft Chat Support or phone based activation:

1. Press Windows key + X then clickRun, then type: slui.exe 4
2. Next press the ‘ENTER’ key
3. Select your ‘Country’ from the list.
4. Choose the ‘Phone Activation’ option.
5. Stay on the phone (do not select/press any options) and wait for a person to help you with activation.
6. Explain your problem clearly to the support person.

–jeroen

## permissions – recursively change owner windows 7 – Super User

Posted by jpluimers on 2016/10/27

Slightly updated the answer the /D Y part will recursively accept taking ownership when directory listing is denied in the permissions:

To fix really broken permissions, the best is to run these two commands one after the other:

takeown /F /D Y "C:\path\to\folder" /R
icacls "C:\path\to\folder" /reset /T

The first one will give you ownership of all the files, however that might not be enough, for example if all the files have the read/write/exec permissions set to “deny”. You own the files but still cannot do anything with them.

In that case, run the second command, which will fix the broken permissions.

–jeroen

## Batch files to show the User/System environment variables stored in registry – via: Stack Overflow

Posted by jpluimers on 2016/09/20

I wrote two tiny batch files that would dump the environment variables from the registry.

Various reasons:

1. Environment variables can be stored in two contexts: System and User (SET will show them all at once and for instance combine PATH up to 1920 characters).
2. Environment variables can be set to auto-expand or not, which you cannot see from a SET command (REG_EXPAND_SZ versus REG_SZ).

show-user-environment-variables.bat:

reg query "HKCU\Environment"

show-system-environment-variables.bat:

reg query "HKLM\SYSTEM\CurrentControlSet\Control\Session Manager\Environment"

Filtered results:

## 4K/5K monitors: when your RDP session has small black bands limiting the height/width to 2048/4096 pixels

Posted by jpluimers on 2016/08/29

Sometimes RDP limits you to 2048 pixels vertical (or 4096 pixels horizontal)

Just found out why on some Windows versions, the RDP sessions form my 4K monitor has some small black bands on top/bottom: older versions of Windows limit their RDP server to 4096 x 2048.

A 4K monitor will not hit the width limit (as 4K cheats: it is usually “just” 3840 pixels wide), but it does hit the height limitation (2160 is slightly more than 2048: you miss 112 pixels that show as two small black bands).

A 5K monitor is worse: it will hit both limits (5K does not cheat: at 5120 × 2880 it is exactly 5*1024 pixels wide) so you miss 124 pixels horizontally and a whopping 832 pixels vertically.

Don’t buy a 5K monitor yet if you do a lot of RDP work to older Windows versions.

The link below has a table listing various Windows versions, but it omits end-of-life versions so I’ve done some testing: Windows XP, Windows Vista, Windows Server 2003 and Windows Server 2003 R2 share the same limitations as Windows Server 2008 most likely because their latest service packs share the same RDP 6.1 version.

I updated this in the table: