1

I'm calling an exe in a .bat file that returns quickly and I'd like to popup a message box with the results of the text so I can read it (after the program has ended). My .bat looks like this:

curl.exe -someparameters

What do I need to do to make that show a message box after the curl call?

EDIT: If there's a better way to do this with PowerShell I'm up for that too.

3 Answers 3

4
curl.exe -someparameters
pause
2

If notepad would be OK for your popup window, then you could use the following. In this case, you would just click on the red X in the upper right instead of an OK button.

@echo off
curl.exe -someparameters > %TEMP%\output.txt 2>&1
notepad output.txt
del %TEMP%\output.txt

The 2>&1 will redirect both STDOUT (standard-out) and STDERR (standard-error) to output.txt.

2
  • This didn't seem to work for me. Is it missing a line to launch notepad?
    – James Cadd
    Apr 27, 2012 at 21:12
  • Oops, fixed. Add the notepad line!
    – jftuga
    Apr 27, 2012 at 23:33
1

Substituting your results for "foo" below:

@echo MsgBox "foo" > %TEMP%\msgbox.vbs
@cscript //NOLOGO %TEMP%\msgbox.vbs

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .