Set WshShell = WScript.CreateObject("WScript.Shell")

If WScript.Arguments.Count = 0 Then
    WScript.Echo "Error: No parameters."
    WScript.Quit
End If

Dim WinVer
WinVer = WScript.Arguments(0)

If Winver = "Win10" Then
WshShell.Run "Files\Profwiz.msi"
WScript.Sleep 5000
WshShell.SendKeys "{TAB}"
WScript.Sleep 100
WshShell.SendKeys "{TAB}"
WScript.Sleep 100
WshShell.SendKeys "{UP}"
WScript.Sleep 100
WshShell.SendKeys "{ENTER}"
WScript.Sleep 5000
WshShell.SendKeys "{TAB}"
WScript.Sleep 100
WshShell.SendKeys " "
WScript.Sleep 100
WshShell.SendKeys "{ENTER}"
WScript.Sleep 1000
WshShell.AppActivate "User Profile Wizard"
WScript.Sleep 1000
WshShell.SendKeys "{ENTER}"
End If

If WinVer = "Win11" Then
WshShell.Run "Files\Profwiz.msi"
WScript.Sleep 5000
WshShell.SendKeys "{TAB}"
WScript.Sleep 100
WshShell.SendKeys "{TAB}"
WScript.Sleep 100
WshShell.SendKeys "{UP}"
WScript.Sleep 100
WshShell.SendKeys "{ENTER}"
WScript.Sleep 5000
WshShell.SendKeys "{TAB}"
WScript.Sleep 100
WshShell.SendKeys " "
WScript.Sleep 100
WshShell.SendKeys "{ENTER}"
WScript.Sleep 1000
WshShell.AppActivate "User Profile Wizard"
WScript.Sleep 1000
WshShell.SendKeys "{ENTER}"
End If