1. You are viewing our forum as a guest. For full access please Register. WindowsBBS.com is completely free, paid for by advertisers and donations.

How to make a user specific log on message

Discussion in 'Legacy Windows' started by PlatinumRik, 2003/04/01.

Thread Status:
Not open for further replies.
  1. 2003/04/01
    PlatinumRik

    PlatinumRik Inactive Thread Starter

    Joined:
    2003/04/01
    Messages:
    5
    Likes Received:
    0
    How can I make a message box appear when a specific user logs on? and how can I it possible, control how many times it appears?

    thanks
    Rick
     
  2. 2003/04/02
    unixfan

    unixfan Inactive

    Joined:
    2002/01/26
    Messages:
    282
    Likes Received:
    0
    Check the %username% variable and launch a message box (vbscript) when appropriate. Sample batch file below for one user - not elegant but should give you some ideas...
    Code:
    :: popupmsg.bat
    
    if %username% NEQ rik goto end
    
    :: display message 9 times
    if not exist e:\%username%count.txt set times_run=1&goto check
    for /f  "tokens=1,2 delims==" %%a in (e:\%username%count.txt) do set times_run=%%b
    set /a times_run = times_run + 1
    :check
    if  "%times_run%" EQU  "10" goto end
    echo > e:\%username%count.txt times_run=%times_run%
    
    set _t1= "Yesterday I got so old... Go on go on "
    set _t2= "The Cure "
    
    echo CreateObject( "WScript.Shell ").Popup %_t1%,,%_t2%>%temp%.\~.vbs
    CSCRIPT //I //NoLogo %TEMP%.\~.vbs
    del %TEMP%.\~.vbs
    
    for %%V in (_t1 _t2) do set %%V=
    
    :end
    
    pause
     
    Last edited: 2003/04/02

  3. to hide this advert.

Thread Status:
Not open for further replies.

Share This Page

  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.