#!/usr/bin/env bash

sourcepath=/Volumes/Windows11
HIVEXSH="$HOME"/Desktop/tools/bin/hivexsh

softhivepath="$sourcepath/Windows/System32/config/SOFTWARE"
namescript="cd Microsoft\Windows NT\CurrentVersion\nlsval ProductName\nunload\n"
winproduct=$(printf "$namescript" | "$HIVEXSH" "$softhivepath" | cut -d' ' -f 1,2)

echo winproduct - "$winproduct"