Short answer is you don't :P That'd be a different script.
But to modify the above script assuming you're using the one I think you are it'd be:
Think that's right, unless I missed an edit :P (Saying that think I missed one of the "'s on the variable the way you're doing it :P
'Set path to the exe installer.
dotnetexe = "\\cpsictserver\netlogon\msi\dotNetFx40_Full_x86_x64.exe /quiet /passive /norestart",0,True"
Set WSHShell = WScript.CreateObject("WScript.Shell")
'Check if PC already has DotNet installed
If KeyExists("HKLM\SOFTWARE\Microsoft\NET Framework Setup\NDP\v4\Full\Install") Then
'Do nothing, DotNet is installed.
set oEnv = WshShell.Environment("PROCESS")
oEnv("SEE_MASK_NOZONECHECKS") = 1
'On Error Resume Next
Set objShell = CreateObject("WScript.Shell")
Set objShell = Nothing
If Err = 0 Then KeyExists = True
If it does complain, just try it with:
Instead of the var to see if it does fix it.
wshShell.Run("\\cpsictserver\netlogon\msi\dotNetFx40_Full_x86_x64.exe /quiet /passive /norestart",0,True)