问题
I am running the script listed in the link below.
PwExpChk.vbs can I add a company logo?
I have substituted the Msgbox with the following:
if (daysLeft < warningDays) and (daysLeft > -1) then
strCMD = "\\domain\netlogon\PwExpChk\PWReminder.hta" -13
Set wshShell = CreateObject("Wscript.Shell")
RC = WshShell.run(strCMD , 0, False)
End if
It is failing at:
strCMD = "\\domain\netlogon\PwExpChk\PWReminder.hta" -13
I ran the command using the mshta.exe manually and it ran successfully. If I remove the -13 it runs successfully.
The error that generates is "Type mismatch: '[string "\\domain\netlogon\"]'
... the -13 needs to be there, Any help would be great
EDIT Add code from below
I tried the one below and it calls the hta file... now the hta file errors out.
if (daysLeft < warningDays) and (daysLeft > -1) then
strCMD = "\\domain\netlogon\PwExpChk\PWReminder.hta" & " -" & intDaysRemaining
Set wshShell = CreateObject("Wscript.Shell")
RC = WshShell.run(strCMD , 0, False)
End if
回答1:
This will take care of your syntax error
Change the offending line to
strCMD = "\\domain\netlogon\PwExpChk\PWReminder.hta -13"
EDIT - if you NEED the quotes in there, then use double quoting
strCMD = """\\domain\netlogon\PwExpChk\PWReminder.hta""" & " -13"
vbscript was thinking you wanted to subtract 13 from a string
来源:https://stackoverflow.com/questions/38386289/vbscript-statement-mismatch-string-failing