Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

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.

share|improve this question
add comment

3 Answers

up vote 4 down vote accepted
curl.exe -someparameters
pause
share|improve this answer
add comment

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.

share|improve this answer
    
This didn't seem to work for me. Is it missing a line to launch notepad? –  James Cadd Apr 27 '12 at 21:12
    
Oops, fixed. Add the notepad line! –  jftuga Apr 27 '12 at 23:33
add comment

Substituting your results for "foo" below:

@echo MsgBox "foo" > %TEMP%\msgbox.vbs
@cscript //NOLOGO %TEMP%\msgbox.vbs
share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.