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

If WScript.Arguments.Count = 0 Then
    WScript.Echo "Error: No credentials provided. Please pass the credentials as parameters."
    WScript.Quit
End If

Dim WinVer
WinVer = WScript.Arguments(0)

Dim Email
Email = WScript.Arguments(1)

Dim Pass
Pass = WScript.Arguments(2)

If WinVer = "Win10" Then
WshShell.Run "ms-settings:workplace"
WScript.Sleep 3000
WshShell.SendKeys "{TAB}"
WScript.Sleep 200
WshShell.SendKeys "{TAB}"
WScript.Sleep 200
WshShell.SendKeys "{ENTER}"
WScript.Sleep 10000
WshShell.SendKeys "{TAB}"
WScript.Sleep 200
WshShell.SendKeys "{ENTER}"
WScript.Sleep 7000
WshShell.SendKeys Email
WScript.Sleep 500
WshShell.SendKeys "{ENTER}"
WScript.Sleep 5000
WshShell.SendKeys Pass
WScript.Sleep 1000
WshShell.SendKeys "{ENTER}"
End If

If WinVer = "Win11" Then
WshShell.Run "ms-settings:workplace"
WScript.Sleep 3000
WshShell.SendKeys "{TAB}"
WScript.Sleep 200
WshShell.SendKeys "{TAB}"
WScript.Sleep 200
WshShell.SendKeys "{TAB}"
WScript.Sleep 200
WshShell.SendKeys "{ENTER}"
WScript.Sleep 5000
WshShell.SendKeys "{TAB}"
WScript.Sleep 200
WshShell.SendKeys "{ENTER}"
WScript.Sleep 5000
WshShell.SendKeys Email
WScript.Sleep 500
WshShell.SendKeys "{ENTER}"
WScript.Sleep 5000
WshShell.SendKeys Pass
WScript.Sleep 1000
WshShell.SendKeys "{ENTER}"
End If