Welcome guest. Before posting on our computer help forum, you must register. Click here it's easy and free.

Author Topic: Welcome banner  (Read 3510 times)

0 Members and 1 Guest are viewing this topic.

asdasfas

  • Guest
Welcome banner
« on: February 26, 2008, 06:38:06 AM »
Let's say I have a .TXT file, with 20 welcome messages, and when I start my computer, i want that a  .BAT file , can take a message from that TXT file (let's say i want that .BAT file take that message from  the .TXT after 1 minut) , and put it in a CMD, give an "Enter" , and after that the CMD will close it himself .
Can anybody help me pls ?

I hope that I explain well.
Thanks all !!!

blastman



    Hopeful

    Re: Welcome banner
    « Reply #1 on: February 26, 2008, 07:26:31 AM »
    I think I understand what you mean.

    As far as I'm aware you can only take the top line of a txt file in to a batch file as a varible, so can be used elsewhere.

    Can you give an example of what the txt file will hold??

    Blastman, you are the man. Thank You Very Much!!!!!!!!!



    asdasfas

    • Guest
    Re: Welcome banner
    « Reply #2 on: February 26, 2008, 12:16:23 PM »
    i think also at this, and i do not know if he can take me from the TXT file for example...
    Heloo User
    but i think he can take me if i use
    Hello_User

    It`s OK also if the .BAT file can take only the first line, i will make let`s say, 20 .TXT file and the .BAT file chose one from this 20 .TXT files.
    1.txt   Hello And Have A Nice Day
    2.txt What A Beautiful Day Is Today :P

    Like a /usr/games/fortune in Linux


    GuruGary



      Adviser
      Re: Welcome banner
      « Reply #3 on: February 26, 2008, 10:46:15 PM »
      If I understand right, you want a batch file that can print out a random line from a file?  If so, you should be able to create a file called "banner.txt" with your 20 lines, and use the following code:
      Code: [Select]
      @echo off
      setlocal
      set file=banner.txt
      for /f %%a in ('find /v /c "" ^< %file%') do set lines=%%a
      set /a line=%random%%%lines
      for /f "skip=%line% delims=" %%a in (%file%) do echo %%a&exit /b

      lecce

      • Guest
      Re: Welcome banner
      « Reply #4 on: February 27, 2008, 02:58:16 AM »
      i also have a problem like this:
      i make a little .EXE that can do DNS and WHOIS in cmd
      C:\wd>wd.exe
         Ip Here (eg. 127.0.0.1 ) : ...............
      The problem is, that when I run wd.exe, my .EXE program,  need that an IP adress be there.
      Where is ................. MUST BE AN IP ADRESS
      Can a bat do this for me ? can take a line from a .TXT file ?
      Can somebody help me pls ?
      Have A Nice Code All

      Dias de verano

      • Guest
      Re: Welcome banner
      « Reply #5 on: February 27, 2008, 03:22:32 AM »
      lecce, you should start your own thread for this, and not ask your question at the end of somebody elses.

      blastman



        Hopeful

        Re: Welcome banner
        « Reply #6 on: February 27, 2008, 03:27:00 AM »
        i also have a problem like this:
        i make a little .EXE that can do DNS and WHOIS in cmd
        C:\wd>wd.exe
           Ip Here (eg. 127.0.0.1 ) : ...............
        The problem is, that when I run wd.exe, my .EXE program,  need that an IP adress be there.
        Where is ................. MUST BE AN IP ADRESS
        Can a bat do this for me ? can take a line from a .TXT file ?
        Can somebody help me pls ?
        Have A Nice Code All

        *censored* Hijacker.......

        Blastman, you are the man. Thank You Very Much!!!!!!!!!