# The Wiert Corner – irregular stream of stuff

• ## Email Subscription

Join 1,715 other followers

# Archive for the ‘Windows Server 2003’ Category

## 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:

## Some notes on apcupsd, a SUA3000XLI and a SUA48XLBP battery pack

Posted by jpluimers on 2016/08/22

I’ve had a SUA3000XLI for years using the USB cable and default Windows support as PowerChute Personal Edition would fail to recognise it and abort installation (so I could not use APC drivers as described on youtube).

A while ago, Liander – the energy distribution company – wanted to replace both the gas and electricity meters to become “smart” during day time. The server configuration load was heavy enough for Windows to indicate the UPS would last about 30 minutes. At night that’s not much of a problem but during 1 hour replacement day-time it would be a problem.

So I bought a SUA48XLBP battery pack (and a SUA039 cable as the cable wasn’t long enough to keep an inch or so air space between UPS and battery pack) so the battery would last about 3 times as long.

Windows would still show it would last about 30 minutes. Strange. So I started looking around and it appeared the SUA3000XLI needed calibration which requires PowerChute. Since PowerChute won’t work, I was almost back at square 1. Almost, as I know knew it required calibration.

In the past I had come across apcupcd but that was a long time ago when it supported a limited set of operating systems and a limited set of features so I never installed it.

But when searching how to calibrate the without using PowerChute, it quickly appeared that the apctest part of apcupsd can do just that: soft calibrate the UPS/battery combo. There are some steps and prerequisites (the most important ones are to turn off the apcupsd and provide enough load and 100% battery charge at start).

Spoiler: the combined UPS/battery-pack now lasts for almost 2 hours which is long enough.

### Installing apcupsd

I’m describing this from a Windows perspective and it’s dead easy:

2. run the installer
3. allow the driver to be installed
1. indicate it’s OK to install an unsigned driver
2. now Windows won’t recognise the UPS any more, but in a few steps the apcupsd and helper program will
4. update the configuration file (no changes needed when it’s a USB connected one)
5. wait for the service to start
6. wait for the apctray helper program to start
7. look in the “system tray” for apctray helper program icon
8. optionally configure your system to auto-start apctray after logon

The USB connection to the UPS delivers slightly less options than using a serial cable

## Make A Bootable Windows 10 USB Install Stick On Linux With WinUSB Fork ~ Web Upd8: Ubuntu / Linux blog

Posted by jpluimers on 2016/07/29

One day I’m going to need this: Make A Bootable Windows 10 USB Install Stick On Linux With WinUSB Fork ~ Web Upd8: Ubuntu / Linux blog

So I’m glad WinUSB (which hadn’t been maintained for a long time) got forked on github by slaka.

Since my day-to-day unix-like system is OS X, I’d love a good working solution there too which means I probably need to investigate a bit along these lines:

–jeroen