Question

Does anyone know how to have a dialog box with a custom message pop up any time that a specific program is opened? The computer is running Windows XP Professional 2002 with Service Pack 3. The program is used to operate a scientific instrument that keeps getting damaged by lab users who disregard printed instructions around it. Ideally, I could have a dialog box pop up that requires users to click an "OK" button before the program opens. I've spent some time browsing the web for ideas, but have so far come back empty-handed. The program is usually opened from a shortcut on the desktop.

Many thanks,

Jeremy

Was it helpful?

Solution

A user on another forum answered this question for me. I created a small shell script (text file saved with .vbs extension) to display the dialog box when the program is opened from a Desktop shortcut targeting the script file.

Here's the link to the post in the other forum for more details:

The script that worked for me is shown below:

startupMessage = MsgBox("...close the lid gently and only use the button to open it.", 0, "To prevent instrument damage...")
Set WshShell = WScript.CreateObject("WScript.Shell")
Dim cmd
cmd = "C:\Program Files\InstrumentApplication.exe"
cmd = chr(34) & cmd & chr(34)
WshShell.Run(cmd)
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top