Loading ...
Sorry, an error occurred while loading the content.

Re: [BATCH WORLD] VERIFYING THE EXISTANCE OF A DIRECTORY

Expand Messages
  • Michael Marquart
    Try this if not exist c: DIRNAME nul goto nodir This technique is not reliable over a network. On Mon, 08 Jul 2002 06:03:37 -0400, Ken Ross
    Message 1 of 7 , Jul 8, 2002
    • 0 Attachment
      Try this

      if not exist c:\DIRNAME\nul goto nodir


      This technique is not reliable over a network.


      On Mon, 08 Jul 2002 06:03:37 -0400, Ken Ross <newsgroups@...>
      wrote:

      >I need to verify the existence of a blank directory. Have tried the
      >following but it always goes to NODIR even when the directory does
      >exist. Using Windows98.
      >
      >if not exist c:\DIRNAME\ goto nodir
    • Ken Ross
      Worked. Thanks! Is there a simple way to have the batch file prompt for a drive letter and place the input into a variable so that it could be used to create a
      Message 2 of 7 , Jul 8, 2002
      • 0 Attachment
        Worked. Thanks!

        Is there a simple way to have the batch file prompt for a drive letter
        and place the input into a variable so that it could be used to create a
        directory?

        Ken



        Michael Marquart wrote:

        > Try this
        >
        > if not exist c:\DIRNAME\nul goto nodir
        >
        > This technique is not reliable over a network.
        >
      • Michael Marquart
        No worries. For W2K/XP you can use set /p var=Enter the drive letter now: echo %var% If you supply more information there may be another way to get a drive
        Message 3 of 7 , Jul 8, 2002
        • 0 Attachment
          No worries.

          For W2K/XP you can use

          set /p var=Enter the drive letter now:
          echo %var%


          If you supply more information there may be another way to get a drive
          letter. OS? Do you want the current drive letter? etc.


          On Mon, 08 Jul 2002 08:30:54 -0400, Ken Ross <newsgroups@...>
          wrote:

          >Worked. Thanks!
          >
          >Is there a simple way to have the batch file prompt for a drive letter
          >and place the input into a variable so that it could be used to create a
          >directory?
          >
        • Ken Ross
          I am using Windows 98. Ken
          Message 4 of 7 , Jul 8, 2002
          • 0 Attachment
            I am using Windows 98.
            Ken

            Michael Marquart wrote:

            > No worries.
            >
            > For W2K/XP you can use
            >
            > set /p var=Enter the drive letter now:
            > echo %var%
            >
            >
            > If you supply more information there may be another way to get a drive
            >
            > letter. OS? Do you want the current drive letter? etc.
            >
            >
            > On Mon, 08 Jul 2002 08:30:54 -0400, Ken Ross <newsgroups@...>
            >
            > wrote:
            >
            > >Worked. Thanks!
            > >
            > >Is there a simple way to have the batch file prompt for a drive
            > letter
            > >and place the input into a variable so that it could be used to
            > create a
            > >directory?
            > >
            >
            >
            > To Post a message, send it to: batchworld@...
            >
            > To Unsubscribe, send a blank message to:
            > batchworld-unsubscribe@...
            >
            > Your use of Yahoo! Groups is subject to the Yahoo! Terms of Service.
          • Michael Marquart
            On Mon, 08 Jul 2002 09:00:32 -0400, Ken Ross ... @echo off ... set input= echo INPUT.BAT echo Type in something and press [Enter] fc
            Message 5 of 7 , Jul 8, 2002
            • 0 Attachment
              On Mon, 08 Jul 2002 09:00:32 -0400, Ken Ross <newsgroups@...>
              wrote:

              >I am using Windows 98.
              >Ken


              @echo off
              :INPUT.BAT puts what is typed next in environment variable INPUT
              set input=
              echo INPUT.BAT
              echo Type in something and press [Enter]
              fc con nul /lb1 /n|date|find " 1: ">temptemp.bat
              echo :Loop>>enter.bat
              echo if not (%%input%%)==() set input=%%input%% %%5>>enter.bat
              echo if (%%input%%)==() set input=%%5>>enter.bat
              echo shift>>enter.bat
              echo if not (%%5)==() goto Loop>>enter.bat
              for %%x in (call del) do %%x temptemp.bat
              del enter.bat
              echo The string you just entered:
              echo %input%
              echo has been stored in an environment variable named INPUT
              :End
            • Ken Ross
              This works really great! You are THE MAN. Thank you. Ken ... [Image]
              Message 6 of 7 , Jul 8, 2002
              • 0 Attachment
                This works really great! You are THE MAN. Thank you.
                Ken

                Michael Marquart wrote:

                > On Mon, 08 Jul 2002 09:00:32 -0400, Ken Ross
                > <newsgroups@...>
                > wrote:
                >
                > >I am using Windows 98.
                > >Ken
                >
                >
                > @echo off
                > :INPUT.BAT puts what is typed next in environment variable INPUT
                > set input=
                > echo INPUT.BAT
                > echo Type in something and press [Enter]
                > fc con nul /lb1 /n|date|find " 1: ">temptemp.bat
                > echo :Loop>>enter.bat
                > echo if not (%%input%%)==() set input=%%input%% %%5>>enter.bat
                > echo if (%%input%%)==() set input=%%5>>enter.bat
                > echo shift>>enter.bat
                > echo if not (%%5)==() goto Loop>>enter.bat
                > for %%x in (call del) do %%x temptemp.bat
                > del enter.bat
                > echo The string you just entered:
                > echo %input%
                > echo has been stored in an environment variable named INPUT
                > :End
                >
                >
                >
                > Yahoo! Groups Sponsor
                [Image]
                >
                > To Post a message, send it to: batchworld@...
                >
                > To Unsubscribe, send a blank message to:
                > batchworld-unsubscribe@...
                >
                > Your use of Yahoo! Groups is subject to the Yahoo! Terms of Service.
              Your message has been successfully submitted and would be delivered to recipients shortly.