Re: MsgBox Timeout

Tech-Archive recommends: Fix windows errors by optimizing your registry



The difference is that the scripting example has the function return a
value, which is assigned to the variable. You use either:

intReturn = objShell.Popup("Click Yes or No!", 20, "My Title", vbYesNo +
vbQuestion)

or:

objShell.Popup "Message", 20, "My Title"

In the first example, you can test with code similar to:

If (intReturn = vbYes) Then
' User clicked "Yes".
End If
If (intReturn = vbNo) Then
' User clicked "No".
End If

--
Richard Mueller
Microsoft MVP Scripting and ADSI
Hilltop Lab - http://www.rlmueller.net
--

"Marcus Cotey" <MarcusCotey@xxxxxxxxxxxxxxxxxxxxxxxxx> wrote in message
news:AFDE4D9D-476A-4475-A7C9-8C1158BA7D7E@xxxxxxxxxxxxxxxx
Interesting. That definitely worked. Sorry for the confusion. I was
going
by the Scripting Guys example here which is why I had the ().

http://www.microsoft.com/technet/scriptcenter/resources/qanda/mar05/hey0314.mspx

"S Moran" wrote:

no, remove the parenthesis surrounding PopUp.

you have: objShell.PopUp("something in here")

you should have: objShell.PopUp "something in here"



"Marcus Cotey" <MarcusCotey@xxxxxxxxxxxxxxxxxxxxxxxxx> wrote in message
news:6071C063-C3C8-4567-9E45-79465D11B8FB@xxxxxxxxxxxxxxxx
Please elaborate...you are saying that the equation I am using to
convert
the
AD password age to a readable format (nanoseconds to seconds to days)
is
actually a subroutine even though I haven't defined it as a subroutine?

"S Moran" wrote:

but you are.
remove the parenthesis or set a variable to contain the return value



"Marcus Cotey" <MarcusCotey@xxxxxxxxxxxxxxxxxxxxxxxxx> wrote in
message
news:5875EDA4-7B6B-482A-8CC3-34DF949856AC@xxxxxxxxxxxxxxxx
Before anyone replies let state first I have tried wshShell.PopUp
and
it
won't work because I am displaying some output that it thinks is
calling a
subroutine.

So what I am doing is writing a login script for our company and
part
of
that is displaying mapped drives as well as when the password
expires.
Well
near as I can tell when I use the PopUp method it thinks the
equations
I
have
in the script to determine password age is a subroutine and returns
an
error
"Cannot use parantheses when calling a Sub" and the error Code:
800A0414.

I am not calling a subroutine but it seems to think so.

Here is the code:
objShell.PopUp ("*** MyCompany Windows Login Process***" & VbCrLf &_
"Good day " & objUser.FullName & VbCrLf &_
"Your password will expire on: " & VbCrLf &_
DateValue(dtValue + dblMaxPwdDays) & " (" & _
Int((dtValue + dblMaxPwdDays) - Now) & " days from today)." & VbCrLf
&_
VbCrLf &_
"Current Drive Mappings: " & VbCrLf &_
strMsg & VbCrLf &_
VbCrLf &_
"If you are having login problems please " & VbCrLf &_
"contact the IT Help Desk at 555.555.5555", 0, "MyCompany Login
Script")

Any help would be greatly appreciated.






.



Relevant Pages

  • Re: MsgBox Timeout
    ... Microsoft MVP Scripting and ADSI ... actually a subroutine even though I haven't defined it as a subroutine? ... "Cannot use parantheses when calling a Sub" and the error Code: ... strMsg & VbCrLf &_ ...
    (microsoft.public.scripting.vbscript)
  • Re: MsgBox Timeout
    ... that is displaying mapped drives as well as when the password expires. ... in the script to determine password age is a subroutine and returns an error ... "Cannot use parantheses when calling a Sub" and the error Code: ... strMsg & VbCrLf &_ ...
    (microsoft.public.scripting.vbscript)
  • Re: Net Send script help
    ... How can I modify my script to display a list of all the PCs that got the message using the msgbox function? ... For Each strName in arrPCNames ... strNameSum = strNameSum & vbCrLf & strName ... torgeir, Microsoft MVP Scripting and WMI, Porsgrunn Norway Administration scripting examples and an ONLINE version of the 1328 page Scripting Guide: ...
    (microsoft.public.scripting.vbscript)
  • Re: Paradox 10 DDE and word 2007 on Vista
    ... Scripting to word 2007 and calling the macros from there will be a good work ... Jim Hargan wrote: ...
    (comp.databases.paradox)
  • Re: Script to get Computer Memory Config
    ... > vbCrLf ... > Function IsConnectible(sHost, iPings, iTO) ... > torgeir, Microsoft MVP Scripting and WMI, Porsgrunn Norway ...
    (microsoft.public.scripting.vbscript)