Announcement

Collapse
No announcement yet.

batch file "pause" question

Collapse
X
  • Filter
  • Time
  • Show
Clear All
new posts

  • batch file "pause" question

    Right now I have my windows booting with shell=c:\startup.bat

    In that batch file I copy my playlist to my winamp directory and then load the specific playlist. I also check to see if my external hard drive is plugged up and if it is, it runs the autorun.bat process from it.

    Basically my questino is this, is there a way in a batch file to pause for a determined amount of time? Basically I want it to pause for say 1-2 seconds. The problem Im running into is that my startup sound "Welcome to the Grand aMP3 Project" is running just barely long enough that my music starts up behind it. Any ideas? Sorry to just badger on, its a saturday.
    The Grand aMP3 Project
    Car: 96 Pontiac Grand Am
    Current Setup: AMD K62 300MHz, 64MB DIMM RAM, 20GB WD Hard Drive, Basic Video & Sound

  • #2
    Hi grandamp, just add the following line into your batch file where you want the pause to take place:

    choice /n /t:n,2

    The "2" is the number of seconds you want to wait. It can be any value from 0 to 99.

    This is assuming you're using either MS DOS or Win9x.

    Hope this helps.

    Dex

    Comment


    • #3
      thanx dex, i hadnt even thought about anything like that, basically asking a choice but timing out after 2 seconds. I knew I could do that just didnt think about it. Anyway, thanx again.
      The Grand aMP3 Project
      Car: 96 Pontiac Grand Am
      Current Setup: AMD K62 300MHz, 64MB DIMM RAM, 20GB WD Hard Drive, Basic Video & Sound

      Comment


      • #4
        Your welcome.

        Comment


        • #5
          I just thought, this line works a bit better if done like this:

          choice /n /t:y,2>nul

          This simply prevents "echoing" the responce to the screen, and by using Y instead of N you generate an errorlevel 1, which I think, is better than leaving an errorlevel 2 hanging. May not be important, just a safeguard.

          Comment


          • #6
            The NT/2000 resource kit has a sleep command that works for that

            Comment


            • #7
              Since there are some DOS head's here, does anyone know how to create a directory, the name of which is the current date, without having to type in the date?
              Then include the name of this directory in the path of a "copy" command?

              I tried this a while back and gave up as I couldnt figure it out. Can anyone please help?

              Dave

              Comment


              • #8
                the only way I would think to do that, and even this is a real stretch, is to echo the date out to a file (date.txt or something). Then you would have to somehow call the first line of that date.txt and use in the md function. I highly doubt this is at all possible but one can dream. If I were you, I would either learn some programming or have someone program a small program to do what you want.
                The Grand aMP3 Project
                Car: 96 Pontiac Grand Am
                Current Setup: AMD K62 300MHz, 64MB DIMM RAM, 20GB WD Hard Drive, Basic Video & Sound

                Comment


                • #9
                  thenominous, I've seen this before but can't find it at the moment.

                  However, its here somewhere:

                  Batch File Links

                  Its a lot of reading and research, but the answer is out there!

                  If I find it first, I'll post it.

                  Dex

                  Comment


                  • #10
                    http://www.batch.hpg.ig.com.br/index.htm

                    Specifically look at #2 and #5. There are also may additional routines you can play with.

                    If NT/2K/XP is your bag, look here:

                    http://www.jsiinc.com/reghack.htm

                    A good all around site is below:

                    http://www.robvanderwoude.com/index.html

                    Have fun.

                    Comment


                    • #11
                      for /f "delims=" %%a in ('DATE /T') do set Date=%%a
                      for /f "tokens=2-4 delims=/ " %%a in ('DATE /T') do set Date=%%c-%%b-%%a
                      md %DATE%

                      watch the word wrap, should be two lines beginning with for and one md

                      Comment


                      • #12
                        Hey,
                        There are other easier ways, actually i just read a blog posting about it here:
                        http://notetodogself.blogspot.com/20...ch-script.html

                        and another one using a more advanced method:
                        http://notetodogself.blogspot.com/20...-good-way.html

                        i hope that helps you like it helped me

                        Comment

                        Working...
                        X