-2

Actually I have this code:

echo msgbox "My Message",0,"Title" > %tmp%\tmp.vbs 
wscript %tmp%\tmp.vbs
del %tmp%\tmp.vbs

As you know, it show a message box. I want this message box stay always on top, because if my code open a program while the message box is focus, for example:

start /d "C:\Program Files\Adobe\Adobe Photoshop CC 2017" Photoshop.exe

It obviously open PS but the message box goes back.

I hope you can help me!

Thank you!

  • 1
    Possible dupilcate of [How can you create pop up messages in a batch script?](https://stackoverflow.com/questions/12514475) –  Jun 16 '18 at 09:56

1 Answers1

1

All you need to do is to replace your 0:

MsgBox "My Message",vbInformation+vbSystemModal,"Title"

You can even have a little fun and run it directly from within the batch file, carry on working in other windows, but leave the batch waiting for it to be closed.

wMSG.cmd

<!-- :StartCmd
@Echo Waiting . . .
@CScript //Nologo "%~f0?.wsf"
@Choice /M "Was that okay"
@If ErrorLevel 2 Echo Sorry!
@Pause
@Exit /B
:StartWSF -->
<Job><Script Language="vbScript">
MsgBox "My Message",vbInformation+vbSystemModal,"Title"
</Script></Job>

vbInformation+vbSystemModal can be replaced with the values: 64+4096

Compo
  • 36,585
  • 5
  • 27
  • 39
  • It worked perfectly :) , but I used to put 0+64 which show an Information Message icon. I replaced the 0 with vbSystemModal but now I can´t have the icon. CanI have the icon and the vbSystemModa at the same time? – Santiago Cuartas Rmrz Jun 17 '18 at 04:48
  • @SantiagoCuartasRmrz, you asked a specific question, using only `0` and I answered it. Please, in future, ask the question you wanted to ask instead of using fake information and hoping that responders will be kind enough to revisit their answers. **I have updated my answer to incorporate your request**; _if the solution works for you click the large check mark, to the left of my answer, to accept it._ – Compo Jun 17 '18 at 09:44