I can get each one to work by themselves but I can not get them to work together, the logon script uses the strArg =
to call on the HTA file, the HTA file gener
There is your culprit:
strCMD = "\\domain\netlogon\PwExpChk\PWReminder.hta" & " -" & intDaysRemaining
' ~~~~~~~~~~~~~~~~
You never define intDaysRemaining
anywhere in your code, so the variable is empty, meaning your commandline looks like this:
\\domain\netlogon\PwExpChk\PWReminder.hta -
Splitting this commandline at -
gives you an array with an empty string in the last field, which in turn raises the error you observed when you try to multiplicate an empty string with 1.
Demonstration:
>>> cmdline = "\\domain\netlogon\PwExpChk\PWReminder.hta -" >>> a = Split(cmdline, "-") >>> v = a(UBound(a)) >>> WScript.Echo "_" & v & "_" __ >>> i = v * 1 Type mismatch (0xD)
You would have spotted this right away had you added Option Explicit
to your VBScript, or at least bothered to echo the commandline in your HTA when debugging (MsgBox objPasswordHTA.commandLine
).