Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

MsgBox paramenters

Status
Not open for further replies.

jjbansley

Technical User
Jul 26, 2003
17
0
0
GB
Hi there,

Does anyone know if its possible to change
MsgBox parameters, eg text bold, bgcolor
etc, to make announcements standout.

I use vbscript to announce messages when users
login, but most just click ok woithout reading :(

Regards,

John
 
You can specify the buttons and some default graphics like an Exclamation Point, but that is all. MsgBox does not have a Font property to edit.

I hope you find this post helpful. Please let me know if it was.

Regards,

Mark
 
You may consider using the InputBox function looping until some text typed by the user.

Hope This Help, PH.
Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884
 
thanks,

that rules out MsgBox. But is there another way of creating a more custom annoucement window?

thanks,

john
 
You could have a script that launches an htm file. That way you would have full color and graphic capability. You can also hide all buttons and menus so it would for the most part look like a message box.

I hope you find this post helpful. Please let me know if it was.

Regards,

Mark
 
If you go the way of launching IE in a logon script you may have some times latency issues.
Anyway to circumvent some security warnings, play with HTA instead of HTM.

Hope This Help, PH.
Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884
 
This will create the file and open it. having trouble with it prompting to save or open the file. PHV, can you suggest a change to overcome this?

'==========================================================================
'
' NAME: <filename>
'
' AUTHOR: Mark D. MacLachlan , The Spider's Parlor
' URL: ' DATE : 3/18/2004
'
' COMMENT: <comment>
'
'==========================================================================

Set fso = CreateObject("Scripting.FileSystemObject")
set WshShell = CreateObject("WScript.Shell")
htaStartText = "<html><title>Important Message</title><body " & Chr(34) & "width=500, height=400, location=no, menubar=no, status=no, toolbar=no, scrollbars=yes, resizable=yes" & Chr(34)&"><hr><br>" & vbCrLf
msgText = "<h1>Warning</h1>You are attempting to access a company PC. Please stand by while storm troopers are dispatched to beat the stuffing out of you!" & vbCrLf
htaEndTxt = "<hr></body></html>"

If fso.FileExists("c:\notice.hta") Then
fso.DeleteFile("c:\notice.hta")
End If


Set ts = fso.CreateTextFile ("c:\notice.hta", ForWriting)
ts.write htaStartText & msgText & htaEndText


Set IE = CreateObject("InternetExplorer.Application")
IE.navigate2 "c:\notice.hta"

'tried this to get prompt to save or open to go away
'WshShell.AppActivate "iexplore"
'WScript.Sleep 200
'WshShell.SendKeys "+{Tab}"
'WshShell.SendKeys "{Enter}"

While IE.busy
wscript.sleep 10
Wend
IE.Visible=True


I hope you find this post helpful. Please let me know if it was.

Regards,

Mark
 
markdmac, perhaps a ts.Close before launcing IE ?

Hope This Help, PH.
Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884
 
anyone who launches IE during a domain logon should be shot if you ask me, :)
 
anyone who launches IE AT ALL should be killed till they die from it...
 
thanks everyone. Found all your comments useful :)
 
jjbansley, thanks for sharing.
Finally which choice have you made ?
 
An alternative to MsgBox is Wscript.Shell's popup which has a builtin timer to close as mentioned in thread329-801782
Code:
' Countdown message
createobject("wscript.shell").popup "3...", 1, "Login Successful", 64
createobject("wscript.shell").popup "2...", 1, "Login Successful", 64
createobject("wscript.shell").popup "1...", 1, "Login Successful", 64
 
PHV,

I stuck with MsgBox for now, although I am plan to explore the .hta option or the Wscript.Shell's popup, to see what I get from them.

Looks like people are ready to shoot if I go for starting IE on logon :)

thanks,
 
Hi.. why not use GPO, these polices give this function and can be set up on OU's so can be differnet for heach set of users.

we use this to push out our log on policy.
 
yeah i agree that GPO is best for applying policies to machines as itopman suggests.
however for connection drives,printers,deleting files, copying files, registry profiles etc i think logon/off scripts are the way to go
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top