user3719086
user3719086

Reputation: 35

Messages on command prompt

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.

Upvotes: 0

Views: 89

Answers (2)

foxidrive
foxidrive

Reputation: 41297

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"

  )
  )

Upvotes: 1

Lucas Szaron
Lucas Szaron

Reputation: 21

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

msg * %variable%

Upvotes: 0

Related Questions