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

Author Topic: create a text file from batch 2 and how to delay  (Read 5789 times)

0 Members and 1 Guest are viewing this topic.

Carbon Dudeoxide

    Topic Starter
  • Global Moderator

  • Mastermind
  • Thanked: 169
    • Yes
    • Yes
    • Yes
  • Certifications: List
  • Experience: Guru
  • OS: Mac OS
create a text file from batch 2 and how to delay
« on: February 27, 2007, 04:50:43 AM »
Earlier I posted a question 'How can I make a text file from a batch file'
http://www.computerhope.com/cgi-bin/yabb/YaBB.cgi?num=1171809714
I found out how to do it.
Here is a small example of how I plan to use it:

How to create a file from a batch file
:1
@echo off
cls
echo.
echo. Please choose an option
echo.
echo. 1. Save a readme on the desktop.
echo.
set /p a=:
if /I %a%==1 goto :2
:2
@echo off
echo.This is the readme, I just >>C:\Docume~1\%username%\desktop\readme.txt
echo.have to put text here >>C:\Docume~1\%username%\desktop\readme.txt
echo.and it works. lol >>C:\Docume~1\%username%\desktop\readme.txt
cls
echo.
echo. The readme has been saved to your desktop
echo.
pause
goto :1

Try it out  :)

Question:
Is there any way to put like a 3 second delay so i don't have to 'press any key to continue'??

lordoftheplat



    Hopeful

  • teh god.
  • Thanked: 1
    Re: create a text file from batch 2 and how to del
    « Reply #1 on: February 27, 2007, 07:30:45 AM »
    ok try this

    :1
    @echo off
    cls
    echo.
    echo. Please choose an option
    echo.
    echo. 1. Save a readme on the desktop.
    echo.
    set /p a=:
    if /I %a%==1 goto :2
    :2
    @echo off
    echo.This is the readme, I just >>C:\Docume~1\%username%\desktop\readme.txt
    echo.have to put text here >>C:\Docume~1\%username%\desktop\readme.txt
    echo.and it works. lol >>C:\Docume~1\%username%\desktop\readme.txt
    cls
    echo.
    echo. The readme has been saved to your desktop
    echo.
    PING Insert 3=(4-1) second delay
    goto :1


    it should work i think
    but one thing ur original one doesnt work properly it does not create a readme file nor edits the readme file....
    i even changed the file root to C:\
    but still it doesnt work
    « Last Edit: February 27, 2007, 07:46:25 AM by lordoftheplat »
    zepperblood.deviantart.com

    WillyW



      Specialist
    • Thanked: 29
    • Experience: Experienced
    • OS: Windows XP
    Re: create a text file from batch 2 and how to del
    « Reply #2 on: February 27, 2007, 09:50:25 AM »
    Quote

    Is there any way to put like a 3 second delay so i don't have to 'press any key to continue'??


    Yes.

    An option:
    Read this thread - http://www.computerhope.com/cgi-bin/yabb/YaBB.cgi?num=1168025488/8#8
    It is about introducing a wait time.

    There is a file attached to a post in that thread.   You might like to download it and keep it for your future use, even if you decide not to use it for this current project.



    Another option:
    Probably better -  
    Check out:  http://www.computerhope.com/choicehl.htm
    That is about the    choice   command.
    It tells you how to use it.
    Be sure to note the  /T  option.
    Also, at the command line on your computer,  you can type
    choice /?     and hit enter.
    It should respond with some brief help on the choice command.

    I hope this helps.


    .



    Carbon Dudeoxide

      Topic Starter
    • Global Moderator

    • Mastermind
    • Thanked: 169
      • Yes
      • Yes
      • Yes
    • Certifications: List
    • Experience: Guru
    • OS: Mac OS
    Re: create a text file from batch 2 and how to del
    « Reply #3 on: February 27, 2007, 03:39:56 PM »
    If it doesn't work lordoftheplat, try this:

    @echo off
    echo.If this is on your desktop then it should work >>C:\Docume~1\%username%\desktop\readme.txt
    exit.

    This should create a text file on your desktop with the text inside.
    It works for me on XP...

    Carbon Dudeoxide

      Topic Starter
    • Global Moderator

    • Mastermind
    • Thanked: 169
      • Yes
      • Yes
      • Yes
    • Certifications: List
    • Experience: Guru
    • OS: Mac OS
    Re: create a text file from batch 2 and how to del
    « Reply #4 on: February 27, 2007, 08:38:32 PM »
    Oh right, thanks WillyW for the delay file. If i use that, it wont work on other computers will it? because the other computers would need that file in system32.

    lordoftheplat



      Hopeful

    • teh god.
    • Thanked: 1
      Re: create a text file from batch 2 and how to del
      « Reply #5 on: February 28, 2007, 05:05:44 AM »
      dudeoxide still doesnt work some how maybe its cause im running on a stupid
      stupid stupid coputer
      windows XP home 2002
      zepperblood.deviantart.com

      Carbon Dudeoxide

        Topic Starter
      • Global Moderator

      • Mastermind
      • Thanked: 169
        • Yes
        • Yes
        • Yes
      • Certifications: List
      • Experience: Guru
      • OS: Mac OS
      Re: create a text file from batch 2 and how to del
      « Reply #6 on: February 28, 2007, 05:27:39 AM »
      Hey! i'm running on Windows XP Home 2002 too ok, don't diss, lol :P
      It works on my computer and on my other computer which is XP Pro so I don't know why yours isn't working....

      WillyW



        Specialist
      • Thanked: 29
      • Experience: Experienced
      • OS: Windows XP
      Re: create a text file from batch 2 and how to del
      « Reply #7 on: February 28, 2007, 10:43:51 AM »
      Quote
      Oh right, thanks WillyW for the delay file. If i use that, it wont work on other computers will it?

      "it" ??
      What is "it"?
      Your batch file or the  wait  program?

      If you give someone else your batch file to try on their computer, and they do not have the   wait program,  then of course the batch file would not work properly if it is calling the wait program.

      If you give someone else both your batch file and the wait program, and they put them all in their proper places,   then yes,  it should work.

      Quote
      because the other computers would need that file in system32.

      The wait program file would need to be in the path or the current directory, so that it could be executed.
      By your above statement,  it would seem that your   \system32 directory is in your path.


      .



      WillyW



        Specialist
      • Thanked: 29
      • Experience: Experienced
      • OS: Windows XP
      Re: create a text file from batch 2 and how to del
      « Reply #8 on: February 28, 2007, 10:45:35 AM »
      Quote
      Oh right, thanks WillyW for the delay file. If i use that, it wont work on other computers will it? because the other computers would need that file in system32.

      Also -
      be sure to see my first post above regarding:
      Quote
      Another option:
      Probably better -  

      .



      userid

      • Guest
      Re: create a text file from batch 2 and how to del
      « Reply #9 on: February 28, 2007, 03:05:48 PM »
      Hey can someone make a batch file that will make 1000s o txt files that have a differmnt name each time on  my desktop like a prank once  i press enter.

      and make it send via wlm it gets blocked

      Carbon Dudeoxide

        Topic Starter
      • Global Moderator

      • Mastermind
      • Thanked: 169
        • Yes
        • Yes
        • Yes
      • Certifications: List
      • Experience: Guru
      • OS: Mac OS
      Re: create a text file from batch 2 and how to del
      « Reply #10 on: February 28, 2007, 03:38:44 PM »
      I think i got something like Displayname. I got a batch file like with the command
      @echo off
      md

      Then after the 'md' i pasted several essays so it would create a couple hundred folders on my desktop.

      Here is an example of the command:

      @echo off
      md 1 2 3 4

      This would make 4 folders wherever your batch file is, each folder named 1, 2, 3 or 4.
      It's actually kinda fun :P

      fffreak



        Adviser

      • That's right I am a final fantasy freak.
      • Thanked: 3
        • Yes
        • JSPCRepair
      • Certifications: List
      • Experience: Guru
      • OS: Windows 7
      Re: create a text file from batch 2 and how to del
      « Reply #11 on: February 28, 2007, 03:49:59 PM »
      Quote
      Hey can someone make a batch file that will make 1000s o txt files that have a differmnt name each time on  my desktop like a prank once  i press enter.

      and make it send via wlm it gets blocked

      Use with !!caution!! because this takes awhile to clean up.

      Code: [Select]
      FOR /L %%G IN (0,1,1000000) DO echo %%G >> %%G.txt
      Save as filename.bat, then just open it.
      « Last Edit: February 28, 2007, 04:27:27 PM by fffreak »
      Computers are the future, not us. Learn everything you can about them while you still can, soon they will be learning about us... Every bit of advice that I give you is best guess, it is your choice whether or not you listen to it.

      Carbon Dudeoxide

        Topic Starter
      • Global Moderator

      • Mastermind
      • Thanked: 169
        • Yes
        • Yes
        • Yes
      • Certifications: List
      • Experience: Guru
      • OS: Mac OS
      Re: create a text file from batch 2 and how to del
      « Reply #12 on: February 28, 2007, 10:27:56 PM »
      before i try that too, does it create txt files in the directory the batch file is in?
      « Last Edit: March 01, 2007, 05:25:16 AM by carbondudeoxide »

      fffreak



        Adviser

      • That's right I am a final fantasy freak.
      • Thanked: 3
        • Yes
        • JSPCRepair
      • Certifications: List
      • Experience: Guru
      • OS: Windows 7
      Re: create a text file from batch 2 and how to del
      « Reply #13 on: March 01, 2007, 07:10:43 AM »
      Yes, it does.
      Computers are the future, not us. Learn everything you can about them while you still can, soon they will be learning about us... Every bit of advice that I give you is best guess, it is your choice whether or not you listen to it.

      lordoftheplat



        Hopeful

      • teh god.
      • Thanked: 1
        Re: create a text file from batch 2 and how to del
        « Reply #14 on: March 01, 2007, 07:18:35 AM »
        kewl...if i didnt do this hwk...
        i say itz on my usb...
        i go on the teacher's comp
        and i use that program...
        i wonder wad the teacher would say....
        zepperblood.deviantart.com