0

I want to show the result of my function as a pop up message.

This is the code: for /f "delims=" %%i in (1.txt) do (set MyResult= %MyName% %%i && net user %%i /domain | find /I "password last set")

I want to show the result of the "do" function in the pop up box.

the result shows the last time the input user changed his/hers password.

I don't want to use VBscript, i just want it in bat. :)

thank you in advance.

  • 1
    Don't think it is possible with pure `batch`, unless you have a custom application whose only purpose is to echo its argument into a dialog box. VBscript is [not that hard](http://stackoverflow.com/questions/774175/how-can-i-open-a-message-box-in-a-windows-batch-file) – merlin2011 Jun 08 '14 at 08:00

2 Answers2

1

Launch this and you'll see what it shows, and is as near as a popup window:

@echo off
echo in window 1
pause
start "" /w "%comspec%" /c "mode con: cols=26 lines=5 & color 4E & echo.&echo       Feed the DOG&echo.&  echo  Press a key to continue&pause>nul"
echo back in window 1
pause

This code might work for you: and you can adjust the 26 character wide and 5 line window size, and positioning.

@echo off
for /f "delims=" %%i in (1.txt) do (
 set "MyResult=%MyName% %%i"
   for /f delims=" %%j in ('net user %%i /domain ^| find /I "password last set" ') do (
     start "" /w "%comspec%" /c "mode con: cols=26 lines=5 & color 4E & echo.&echo %%j &echo.&  echo  Press a key to continue&pause>nul"

  )
  )
foxidrive
  • 40,353
  • 10
  • 53
  • 68
0

This will work on windows 7,Vista,xp (i think) but not on windows 8 or Windows 'Home' editions.

msg * %variable%