StevenWhiting.com

A place for info I've learnt in IT & stuff. (I get a little kick back from affiliate ads & links, just so you are aware)

We are back

I’ve changed my package and notice they had a deal on for new customers. So managed to drop it to £59.99 a year (I always forget to include VAT). Again, any donations would help but regardless, hope to keep the site up & hopefully my random notes are of help to someone.

wmic path SoftwareLicensingService get oa3xoriginalproductkey

The site was always meant to be a place for my notes that others might find useful. Its been up for 12 years now. Over the years the hosting costs have increased and sadly, this is a year I can’t afford it anymore. Its now £95.99 a year to keep it up. Krystal Hosting are the best hosts I’ve found with good customer support but as I’ve made no money from the site (which was never the point) I now can’t afford it myself, I’m sadly going to have to close it.

So archive it while you can. Hopefully, one day when I have spare cash again it will reappear. Another idea, which will probably never happen, is hosting myself but on and off due to electricity costs so it won’t be available 24/7.

If you’ve found the site useful over the years then a small donation could help keep it up. If enough people donated £1 it could stay up.

Last day the site will be up is the 26th October 2022

Another one and I ended up sticking a load of notes on this for myself

Get-Item “\\SERVERNAME\files\All – all general shared files\April 2020 – Rents and service charges\Archive*.pdf” | ForEach-Object {
Rename-Item $_ ($_.Name -replace “-“, ” “) -WhatIf }

So here are my notes on the command.

Get-Item : We’re getting the contents of the folder on SERVERNAME and looking at all files ending in .pdf

We have to put the path in “” because the folder name has spaces.

We then pipe this with the pipe command (cause it looks like a pipe) | to the ForEach-Object loop. The pipe command means you pass the results of what was just to the left of it, to the next command on its right.

ForEach-Object takes each file, from the Get-Item command and with Rename-Item stores each file’s name in the Powershell global variable $_. You use that global variable because its easy, its short (typing wise) and you don’t have to declare it at the top of your script like other variables. So less code. The $_. global variable is built into Powershell.

The $_.Name takes the contents stored in Global Variable $_ and adds it to name with the (in this case) – removed from all the files that had it and replaced with a space. That is what “-” ” ” are. You’re looking for “-” in the file name and replacing with ” ” space.

The whatif is only there so the command doesn’t actually change anything, it just shows what would happen if the command ran, it can be removed once you know the script works.

Been attempting to learn Powershell, slowly. Needed help with this. Got part of it working but not fully until someone fixed it.

get-childitem -recurse | Where-Object name -Like ‘(2)‘ | ForEach-Object { remove-item -LiteralPath $_.fullname -whatif }

A shorter version

get-childitem -recurse -filter ‘*(2)*’ | remove-item -whatif

The -whatif will run the command but not execute it so NOTHING will be delete. It will just show you what it would do IF you executed the command.

I used this as my sister had loads of photos that I had to back up with

0dd123.jpg, Odd123 (2).jpg

Which was going to be an arse to go through and delete all the (2) copies.

Be aware if you are copying this script from my site because the ‘ are formatted different on the site and I believe if you paste them into Powershell it may not work. Just go and manually replace the ‘. They look exactly the same but the code behind them is somewhat different. I’ve had this happen a few times with code I’ve copied from somewhere that had ‘ in it.

Our hosts decided to reboot. Only one of the hosts wouldn’t start VMs. They’d sit there fine while off but attempt to start them and they’d fail.

“Virtual machine ‘VM Name’ could not be started because hypervisor is not running.”

Turns out this is because of Windows update

KB5009624

KB5009595

Are the cause. Uninstall and all will be fine.

wusa /uninstall /kb:5009595 /quiet /norestart

wusa /uninstall /kb:5009624 /quiet /norestart

You’ll probably need to do a restart but you might want to control it rather than the command doing it.

Probably a good idea to remove from WSUS for now if still using WSUS.

Computer Config\Policies\Admin Templates\Windows Components\Windows Update\Do not connect to any Windows Update Internet Locations

We set this to enable but, as it says, it has the knock on effect that no one can download apps from the Windows Store when enabled. But we enabled this because via the Windows Store you can bypass WSUS and install Windows updates. Which someone did back when an old build of Windows 10 was released that was bricking machines. Lucky the 3 users that had managed to install it, via the Windows Store, were OK but had to rebuild their machines after.

Thought I’d posted this but guess not. Found my old college CDs with my old work on it.

This was my Pascal Lottery Number Picker

Then I converted it to Visual Basic.

The 19 year old bug. Don’t know why I’d never fixed it

Only took a few minutes to work out what the issue was and I still can’t understand why I’d wrapped up the installer to point the images to the wrong directory. Changed it and now fixed.

I’ve now removed all the adverts to Amazon and Google, including the Google search bar. Also the Krystal affiliate link, although I like their service and them as a host (they are very good) their affiliate link program is awful, having to give a 3rd party company about £15 for “admin fees” and I’ve never received anything in return so I just gave up with it. I’ve never seen an affiliate program where you had to pay the company. I stupidly thought I’d get something out of it, I was wrong.

The adverts were never going to make me money or fund the site (I’ve not actually had anything from them, not 1 pence) but that’s all fine. Again, the site was created and still is, mainly for my notes. A place to store them online for me to access anywhere and may be of use for someone else. I’ve removed the cookie warning now as well as I still believe the site complies with GDPR. It’s a hobby site and takes no data that I know of.

If you’d still like to donate, I’d be grateful 🙂 hosting fees come in near the end of the year and it costs £79 a year.

PayPal Donation. Fanks :o)