ZeroNet Blogs

Static ZeroNet blogs mirror

Just some scripts I've wrote to fix the most common Windows issues I've come across when fixing clients' broken machines...

Completely open source, uses native Windows commands and libraries so no install needed - just run as admin and done! All these scripts are compatible with Windows Vista, 7, 8, 8.1 and 10: the script runs the appropriate commands for the appropriate OS and automatically detects the exact OS version, including whether there's any service packs or updates installed and notifying the user if the system is lacking important security updates.

RepairCorruptWindows.cmd

This essentially does a full reinstall of the booted Windows image the script is run on, while keeping all of the user's files, settings and programs (both modern apps and classic Win32 apps).

It does this by scanning and verifying the hash of every single system file part of the OS with the hash on Microsoft's server. For any files with an invalid or mismatching hash, it is replaced with a proper copy direct from the Windows Update servers. This basically does what a full reinstall would do, minus formatting the disk and overwriting files that are okay. It uses SFC (System File Checker) and DISM (Deployment Image Servicing and Management) on the online image to achieve this.

Source code:

@echo off
title=GadgetWorks RepairCorruptWindows tool
echo GadgetWorks RepairCorruptWindows tool - December 2016
echo ======================================================
echo This tool will take a long time to run - especially on mechanical hard drives.
pause
:StartRepair1
echo.
echo Initialising
echo -------------
@echo on
set BINDIR=%~dp0
cd /D %BINDIR%
@echo off

echo.
echo Detecting OS...
echo ----------------
FOR /F "usebackq tokens=4 delims=] " %%I IN (`ver`) DO for /F "tokens=1,2 delims=." %%J IN ("%%I") do set WindowsVersionNum=%%J.%%K
FOR /F "usebackq tokens=4 delims=] " %%I IN (`ver`) DO for /F "tokens=1,3 delims=." %%J IN ("%%I") do set WindowsBuildNum=%%K
echo WindowsVersionNum: %WindowsVersionNum%
echo WindowsBuildNum: %WindowsBuildNum%
if %WindowsVersionNum% EQU 10.0 (set WindowsVersion=10)
if %WindowsVersionNum% EQU 6.3 (set WindowsVersion=8.1)
if %WindowsVersionNum% EQU 6.2 (set WindowsVersion=8)
if %WindowsVersionNum% EQU 6.1 (set WindowsVersion=7)
if %WindowsVersionNum% EQU 6.0 (set WindowsVersion=Vista)
if %WindowsBuildNum% EQU 14393 (set WindowsUpdateName=Anniversary Update)
if %WindowsBuildNum% EQU 10586 (set WindowsUpdateName=November Update)
if %WindowsBuildNum% EQU 10240 (set WindowsUpdateName=RTM) && REM Windows 10 without updates
if %WindowsBuildNum% EQU 9600 (set WindowsUpdateName=Update 1) && REM Windows 8.1.1
if %WindowsBuildNum% EQU 7601 (set WindowsUpdateName=Service Pack 1) && REM Windows 7 SP1
if %WindowsBuildNum% EQU 7600 (set WindowsUpdateName=RTM) && REM Windows 7 without any Service Packs
if %WindowsBuildNum% EQU 6002 (set WindowsUpdateName=Service Pack 2) && REM Windows Vista SP2
if %WindowsBuildNum% EQU 6001 (set WindowsUpdateName=Service Pack 1) && REM Windows Vista SP1
if %WindowsBuildNum% EQU 6000 (set WindowsUpdateName=RTM) && REM Windows Vista without any Service Packs
echo Detected Windows %WindowsVersion% %WindowsUpdateName%
if %WindowsBuildNum% EQU 10586 (call:ConsiderUpdating)
if %WindowsBuildNum% EQU 10240 (call:ConsiderUpdating)
if %WindowsBuildNum% EQU 7600 (call:ConsiderUpdating)
if %WindowsBuildNum% EQU 6001 (call:ConsiderUpdating)
if %WindowsBuildNum% EQU 6000 (call:ConsiderUpdating)

echo.
echo Checking compatibility...
echo --------------------------
if "%WindowsVersion%"=="10" (
    REM Bugfix for Windows version detection on Windows 10
    set WindowsVersionNum=9.9
)
if %WindowsVersionNum% GEQ 6.2 (
    echo Your Windows version is new enough to fully support this tool!
    echo No compatibility fallbacks have been enabled.
)
if %WindowsVersionNum% LSS 6.2 (
    echo Falling back to basic mode as DISM is not available on your version of Windows...
    set FallbackMode=TRUE
)
if %WindowsVersionNum% LSS 6.0 (
    echo ERROR: Your Windows version is too old and is not supported by this tool.
    echo Press any key to exit...
    pause >NUL
    exit
)

echo.
echo Running System File Integrity Scan and Repair...
echo -------------------------------------------------
@echo on
sfc /scannow
@echo off

if "FallbackMode"=="TRUE" (goto SkipDISM)
echo.
echo Running DISM Online Image Cleanup, Scan and Repair...
echo ------------------------------------------------------
@echo on
DISM /Online /Cleanup-Image /RestoreHealth
@echo off
:SkipDISM

echo.
echo ********
echo Finished
echo ********
echo To exit, press any key...
pause >NUL
exit

:ConsiderUpdating
echo Warning: You should consider installing the latest updates on Windows Update.
goto:eof

RepairCorruptStorage.cmd

Remember to run this as admin too! This tool does a filesystem integrity check and also tries to repair bad sectors, allowing it to use as many system resources as needed so that the process finishes as quickly as possible (if supported by the OS)

Source code:

@echo off
title=GadgetWorks RepairCorruptStorage tool
echo GadgetWorks RepairCorruptStorage tool - December 2016
echo ======================================================
echo This tool will take a long time to run - especially on mechanical hard drives.
pause

echo.
echo Initialising
echo -------------
@echo on
set BINDIR=%~dp0
cd /D %BINDIR%
@echo off

echo.
echo Detecting OS...
echo ----------------
FOR /F "usebackq tokens=4 delims=] " %%I IN (`ver`) DO for /F "tokens=1,2 delims=." %%J IN ("%%I") do set WindowsVersionNum=%%J.%%K
FOR /F "usebackq tokens=4 delims=] " %%I IN (`ver`) DO for /F "tokens=1,3 delims=." %%J IN ("%%I") do set WindowsBuildNum=%%K
echo WindowsVersionNum: %WindowsVersionNum%
echo WindowsBuildNum: %WindowsBuildNum%
if %WindowsVersionNum% EQU 10.0 (set WindowsVersion=10)
if %WindowsVersionNum% EQU 6.3 (set WindowsVersion=8.1)
if %WindowsVersionNum% EQU 6.2 (set WindowsVersion=8)
if %WindowsVersionNum% EQU 6.1 (set WindowsVersion=7)
if %WindowsVersionNum% EQU 6.0 (set WindowsVersion=Vista)
if %WindowsBuildNum% EQU 14393 (set WindowsUpdateName=Anniversary Update)
if %WindowsBuildNum% EQU 10586 (set WindowsUpdateName=November Update)
if %WindowsBuildNum% EQU 10240 (set WindowsUpdateName=RTM) && REM Windows 10 without updates
if %WindowsBuildNum% EQU 9600 (set WindowsUpdateName=Update 1) && REM Windows 8.1.1
if %WindowsBuildNum% EQU 7601 (set WindowsUpdateName=Service Pack 1) && REM Windows 7 SP1
if %WindowsBuildNum% EQU 6002 (set WindowsUpdateName=Service Pack 2) && REM Windows Vista SP2
echo Detected Windows %WindowsVersion% %WindowsUpdateName%
if %WindowsBuildNum% EQU 10240 (
    echo Warning: You should consider installing the latest updates on Windows Update.
)

echo.
echo Checking compatibility...
echo --------------------------
if "%WindowsVersion%"=="10" (
    REM Bugfix for Windows version detection on Windows 10
    set WindowsVersionNum=9.9
)
if %WindowsVersionNum% GEQ 6.2 (
    echo Your Windows version is new enough to fully support this tool!
    echo No compatibility fallbacks have been enabled.
)
if %WindowsVersionNum% LSS 6.2 (
    echo Falling back to basic mode as CHKDSK /perf option is not available on your version of Windows...
    set FallbackMode=TRUE
)

if "FallbackMode"=="TRUE" (goto CHKDSKFallback)
echo.
echo Running CHKDSK...
echo ------------------
@echo on
CHKDSK /perf /F /R /I /scan %systemdrive%
@echo off
if not "FallbackMode"=="TRUE" (goto SkipFallback)

:CHKDSKFallback
echo.
echo Running CHKDSK in fallback mode...
echo ------------------
@echo on
CHKDSK /F /R /I /scan %systemdrive%
@echo off
:SkipFallback

echo.
echo ********
echo Finished
echo ********
echo To exit, press any key...
pause >NUL
exit

EnableSuperfetch.cmd

This turns on Windows Superfetch which can significantly improve system performance on all computers. This is on by default on Windows Vista and newer, but some malware may turn it off. You can also use this tool to fix ReadyBoost being unavailable due to a service failing to run.

Source code:

@echo off
title=EnableSuperfetch
echo Note: This tool needs to be run as admin.
pause
sc config SysMain start= auto
sc start SysMain
sc query SysMain
pause
exit

ReduceGoogleBGActivity.cmd

Needs to be run as admin. This reduces the sometimes excessive background activity caused by most Google products. An explanation of what specifically the tool reduces and why can be found at the top of the source code, or when you run the file before confirming the action.

Source code:

@echo off
title=GadgetWorks ReduceGoogleBGActivity tool
echo GadgetWorks ReduceGoogleBGActivity tool - December 2016
echo ========================================================
echo This tool disables and uninstalls certain known Google
echo background services that cause system slowdown and are not
echo required. The most well-known one is "Google Update Helper"
echo which runs on boot, logon and every hour. This is not needed
echo and uses a lot of system resources. Updates are checked by
echo the Google app every time when it's opened, so we don't need
echo an excessive background service on top of that.
pause
:StartRepair1
echo.
echo Initialising
echo -------------
@echo on
set BINDIR=%~dp0
cd /D %BINDIR%
@echo off

echo.
echo Detecting OS...
echo ----------------
FOR /F "usebackq tokens=4 delims=] " %%I IN (`ver`) DO for /F "tokens=1,2 delims=." %%J IN ("%%I") do set WindowsVersionNum=%%J.%%K
FOR /F "usebackq tokens=4 delims=] " %%I IN (`ver`) DO for /F "tokens=1,3 delims=." %%J IN ("%%I") do set WindowsBuildNum=%%K
echo WindowsVersionNum: %WindowsVersionNum%
echo WindowsBuildNum: %WindowsBuildNum%
if %WindowsVersionNum% EQU 10.0 (set WindowsVersion=10)
if %WindowsVersionNum% EQU 6.3 (set WindowsVersion=8.1)
if %WindowsVersionNum% EQU 6.2 (set WindowsVersion=8)
if %WindowsVersionNum% EQU 6.1 (set WindowsVersion=7)
if %WindowsVersionNum% EQU 6.0 (set WindowsVersion=Vista)
if %WindowsBuildNum% EQU 14393 (set WindowsUpdateName=Anniversary Update)
if %WindowsBuildNum% EQU 10586 (set WindowsUpdateName=November Update)
if %WindowsBuildNum% EQU 10240 (set WindowsUpdateName=RTM) && REM Windows 10 without updates
if %WindowsBuildNum% EQU 9600 (set WindowsUpdateName=Update 1) && REM Windows 8.1.1
if %WindowsBuildNum% EQU 7601 (set WindowsUpdateName=Service Pack 1) && REM Windows 7 SP1
if %WindowsBuildNum% EQU 7600 (set WindowsUpdateName=RTM) && REM Windows 7 without any Service Packs
if %WindowsBuildNum% EQU 6002 (set WindowsUpdateName=Service Pack 2) && REM Windows Vista SP2
if %WindowsBuildNum% EQU 6001 (set WindowsUpdateName=Service Pack 1) && REM Windows Vista SP1
if %WindowsBuildNum% EQU 6000 (set WindowsUpdateName=RTM) && REM Windows Vista without any Service Packs
echo Detected Windows %WindowsVersion% %WindowsUpdateName%
if %WindowsBuildNum% EQU 10586 (call:ConsiderUpdating)
if %WindowsBuildNum% EQU 10240 (call:ConsiderUpdating)
if %WindowsBuildNum% EQU 7600 (call:ConsiderUpdating)
if %WindowsBuildNum% EQU 6001 (call:ConsiderUpdating)
if %WindowsBuildNum% EQU 6000 (call:ConsiderUpdating)

echo.
echo Checking compatibility...
echo --------------------------
if "%WindowsVersion%"=="10" (
    REM Bugfix for Windows version detection on Windows 10
    set WindowsVersionNum=9.9
)
if %WindowsVersionNum% GEQ 6.2 (
    echo Your Windows version is new enough to fully support this tool!
    echo No compatibility fallbacks have been enabled.
)
if %WindowsVersionNum% LSS 6.2 (
    echo Falling back to basic mode as DISM is not available on your version of Windows...
    set FallbackMode=TRUE
)
if %WindowsVersionNum% LSS 6.0 (
    echo ERROR: Your Windows version is too old and is not supported by this tool.
    echo Press any key to exit...
    pause >NUL
    exit
)

echo.
echo Disabling Google Update background service...
echo ----------------------------------------------
@echo on
sc config gupdate start= disabled
sc stop gupdate
@echo off

echo.
echo Removing excessive background update checking...
echo -------------------------------------------------
:: Google Update Helper
start /wait msiexec /qn /norestart /x {60EC980A-BDA2-4CB6-A427-B07A5498B4CA}
start /wait msiexec /qn /norestart /x {A92DAB39-4E2C-4304-9AB6-BC44E68B55E2}
start /wait msiexec /qn /norestart /x {A4DE5CD7-96D6-3979-8C39-E864396AFFC0}
start /wait msiexec /qn /norestart /x {5BAA8884-F661-464B-B5B2-5C6C632BFC21}

echo.
echo ********
echo Finished
echo ********
echo To exit, press any key...
pause >NUL
exit

:ConsiderUpdating
echo Warning: You should consider installing the latest updates on Windows Update.
goto:eof

Warning: Very long article :P I posted on ZeroMe about some research I was going to do concerning my personal curiosity about why people still pirate music and why even when using legal methods there are still heavy restrictions in place that weren't really an issue back when CDs were the format of choice back in the day...

So, what is music licensing for?

To understand what music licensing is for, you really need to look at the whole chain from the music artist and people behind making the music all the way to the consumer. Note that my analysis is for the UK market and it is slightly different in how it works in different continents and countries, although I've found that it's mostly the same procedure - just different names for the intermediaries mainly and slightly different copyright laws.

  • In a nutshell, music licensing is how music artists make money from and gain recognition for their work - it's as simple as that.
  • You usually only need to license music when you are using it for commercial uses (such as playing or performing music at a live event, as background audio in a TV show, selling a CD with copyrighted music, etc...)
  • You do not need a license to play music for your own personal enjoyment or leisure - either at home or in a workplace with headphones on. This is where things get interesting... as this gets complicated when someone is using an online music service for their own personal enjoyment or leisure, as both personal and commercial uses are involved simultaneously. See "Why the restrictions on modern day services?" lower down.

What intermediaries are involved?

I've made a chart that explains all the usual intermediaries and people involved in creating, recording, promoting, licensing and selling music. Please excuse it being flipped, you need to read it from the bottom upwards as I didn't realise my mistake until it was all finished. Music licensing chart

How much money actually goes to the artist?

I've asked but they were unable to provide me with an answer as there are too many variables involved. The amount of the licensing fee that actually goes to the artist depends on stuff like: - How often their song has been played on music streaming services - How often their song has been bought as a download (e.g. iTunes purchases) - How much their label/publisher takes from their revenue to pay for the recording, marketing, etc...

The last point is the most variable, as internally the amount they will charge will depend on how well their label is doing, how much profit they want to make, how much it actually cost them to produce the ads, and much, much more.

Why the restrictions on modern day services? And how much does licensing cost?

This is what I found the most interesting... you see, each intermediary has their own job that they carry out for the music artist behind the scenes. Obviously, they all want a profit as very few people will do or even be able to volunteer to work for free - especially considering that most of the time the exact people behind a song aren't fully listed in credits like a film does.

While online music streaming is likely to be used for personal leisure purposes, it is still a public commercial service, hence licensing costs still apply regardless of the use behind the service.

The restrictions on modern music streaming services are because of either technical or licensing constraints

The licensing fees are fixed costs paid annually, but depending on your usage and revenue/income, the charge is different. - If your business' annual gross revenue is under £12.5k, it costs around £0.002 per stream - that's less than half a penny! - If your business' annual gross revenue is between £12.5k and £200k, it costs around £0.003 per stream, BUT your allowance is different depending on how you sold the service: - - There's a restriction on how people can listen to music, including how many devices they can listen to it on and if they can play it offline without needing a "premium subscription" - - Depending on whether you use a subscription-based service or a pay-per-stream service, the allowance and restrictions differ massively - If you become a multinational business, you are required to go through a thorough assessment about your business' contributions to the music industry, how you generate revenue, a full financial assessment and more. They won't give you a quote until you've gone through this long process however the fees and restrictions are highly negotiable.

What's interesting here is that economies of scale don't apply, instead diseconomies of scale do. The better or more popular your online music service becomes, the higher the licensing fees and the more restrictions are involved, which explains why services require you to subscribe to a premium variant in order to do certain things like listen to music offline - it's not the business' choice, it's the licensing restriction.

Can the restrictions be worked around by using a decentralised method? Yes, as long as you still accurately report how many songs have been streamed, how many streams are a song from a specific artist, etc...

Skipping the intermediaries entirely with NinjaBeats

Both me and @technoshaman777 have collectively come up with some ideas that could potentially skip all of the intermediaries between the artist and consumer, by using advanced cutting-edge decentralised technologies and concepts that would remove the technical limitations and can theoretically make the service work as a hybrid streaming service and label/publisher.

What does this mean? It means no technical costs, at all. All while being fully legal! It would mean there would be no hosting costs, no licensing costs, no required reliance on third-party online advertising... The only costs would be the general management of the business and R&D.

Exciting stuff indeed, I could actually see this as a viable business that offers complete freedom of music and therefore eliminates the need for music piracy! :)

A word on piracy

After some internal anonymous research, I found that a significant amount of people who pirate music is because they either do not want to pay for it or they dislike the restrictions that free legal alternatives provide. I'll officially say it now: NinjaBeats' mission is to combine the benefits of pirated and legal offerings into a single, decentralised, free and legal music service. Think of it as like a legal form of piracy with the added benefits of good metadata and audio quality :P

It looks like ZeroNet search engines have been slightly neglected for a while, with a huge boom in ZeroNet content since both were last maintained. It's great that Bwoi and Kaffiene, the two big search offerings, are picking up search again and carrying on to further improve it, which is great!

Here's some of my ideas for search on ZeroNet that could dramatically improve its productivity...

Spellcorrect

A basic but helpful feature - especially for those whose native language isn't English. For example, typing "musik" instead of "music" would still show search results with the tag "music" rather than showing no results.

Zite descriptions

A meta description tag on zites that could be read by search engines would be nice. Sometimes, you just can't really tell what one of the search results are until you click them, which isn't ideal for those who don't know how to delete sites from their client. Having a description provided by the zite author would be great as it would: 1. Improve the potential of a lower ranked zite getting clicked rather than a higher ranked one 2. Give people more insight on what zite they're visiting, which is important on an unmoderated Internet like ZeroNet.

Zite icons

A small improvement could be to show the zite's favicon next to its search result.

Tag aliases

Not everyone uses the same wording when searching for something - for example: someone might type "reading" rather than "books". Having aliases for different tags would reduce the amount of "no results found" messages.

Sentence comprehension

Currently both Kaffiene and Bwoi search for tags and site names as far as I know, but it would be cooler if a search engine could have an understanding of what I was looking for without needing to use the exact same wording on file - think of it as tag aliases but for full questions and sentences. This combined with "tag aliases" would make a ZeroNet search engine very powerful.

For example, if I ask the question "where can I share music with others?" on Kaffiene or Bwoi, I get no results. But with sentence comprehension, the search engine would understand that I'm looking for sites with the tags music and sharing or something like that, and show NinjaBeats in the search results, along with any other service that allows sharing music, ranked by certainty of how suitable each result is to the question. Here's something you could use to achieve this: https://github.com/NaturalNode/natural#classifiers

Search within services

While currently, you search an index of zites, it would be cool if you could search within select services. For example, you can use ZeroMePlus to search for certain posts on ZeroMe.

Being able to go to your normal ZeroNet search engine and search both zites and ZeroMe posts would be cool!

Welcome to my blog

- Posted in PaintNinja's blog by with comments

Here you can find posts about anything I want to write really... although it'll probably be about NinjaBeats or something of the like.

By the way, you can use either KaffieID or the usual ZeroID to post comments on here. Enjoy!