Systems Management Question

How to pop up a message box when no user is logged on

09/03/2008 10128 views
As most SMS administrators know, you can set up a program to run "Only when no user is logged on", which is very useful for installing programs that might otherwise conflict with whatever else the logged on user has running. However, when the user logs out, there is no indication to the user that an installation is running and thus, the user can log back in, or shutdown the computer!

Does anyone know of a way to pop up a message box stating something like "An installation is running, please do not shutdown or log in" when there is no user logged in?

0 Comments   [ + ] Show comments


Rating comments in this legacy AppDeploy message board thread won't reorder them,
so that the conversation will remain readable.

All Answers

Could you try:

SMSClientShowMessage "Application Management", "Installation corrently in progress", 1

Sub SMSClientShowMessage(strTitle, strText, intMessageType)
Dim objUIEvents
On Error Resume Next
Set objUIEvents = CreateObject("SMSCliUI.UIEvents")
objUIEvents.ShowMessage strTitle, Replace(strText, "\n", vbNewLine), intMessageType
Set objUIEvents = Nothing
End Sub
Answered 09/03/2008 by: AngelD
Red Belt

I've tried your code and it only displays the window if a user is logged on.

I found a utility, psexec, which will display a window on the logon screen. Actually, I've had it all along, just didn't know about the -x option that specifies to run the window on the winlogon desktop.

Thanks for the response, anyway.
Answered 09/04/2008 by: MicrosoftBob
Blue Belt

Gread that you found a solution.
I've only used the script while the user was logged in so a shot in the dark [;)]
Answered 09/04/2008 by: AngelD
Red Belt

Hey - i found this article as im looking to do the same thing - however im having some trouble getting the GUI to display at the logon screen with -x

I can get a command prompt showing up - but whenever i start a vbscript, it is fine if im logged on, as it will default to the user session, but it will not run as system at the logon desktop.

are you able to provide an example of how you did it ?
Answered 08/05/2010 by: verukins
Senior Yellow Belt

Try adding the '/accepteula' argument to your command line.
Answered 08/06/2010 by: VBScab
Red Belt

yer, thats already in there... not the issue

interesting inve foudn that if i run an .exe or a bat (or a hta) - the program runs fine

if i run cscript with an arguement, no matter the psexec commands, it still runs in the user session.... interesting.... its a simple command cscript <path><scriptname>

to that end ive changed over my program to a HTA - and it now runs fine.
Answered 08/07/2010 by: verukins
Senior Yellow Belt

Although you have a solution (I *love* HTAs, BTW - scripting+GUI - I'm in heaven!) I'm intrigues to know what the restriction is. Have you tried running the script using the System account (via the old 'AT hh:mm CMD /interactive' ploy to get a System-level command prompt)?
Answered 08/08/2010 by: VBScab
Red Belt

:-) im a bit the oppoisite - i used to script and hta alot, but now i find i only do it when necessary - some of the stuff you casn do is pretty cool - but i find your better off going to .net as soona s you need a gui (i should point out i hate c# - but can do stuff i have to!)

i too am interested as to why the cscript wont run on the desktop... i added the command via AT - still the same issue - do see the command prompt flash up quickly.

In addition, i noticed that running the hta on windows 7 - doesnt show up (know its running, can see the process initiated) - so looks like its only a solution for XP.
Answered 08/08/2010 by: verukins
Senior Yellow Belt

The "problem" with .Net is that to do the UI stuff, you need a development environment, whereas with HTAs, you need only a text editor.

Do post your solution if you ever track it down. As I say, I'm intrigued.
Answered 08/09/2010 by: VBScab
Red Belt

Don't be a Stranger!

Sign up today to participate, stay informed, earn points and establish a reputation for yourself!

Sign up! or login


This website uses cookies. By continuing to use this site and/or clicking the "Accept" button you are providing consent Quest Software and its affiliates do NOT sell the Personal Data you provide to us either when you register on our websites or when you do business with us. For more information about our Privacy Policy and our data protection efforts, please visit GDPR-HQ