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

Re: [BATCH WORLD] RE: Need help with a batch file.

Expand Messages
  • Michael Marquart
    Assuming the environment variable counter is set then in plain batch you can recreate the FTP script, prior to using it, with ECHO commands IE: @echo off echo
    Message 1 of 14 , Feb 1, 2002
    • 0 Attachment
      Assuming the environment variable counter is set then in plain batch you
      can recreate the FTP script, prior to using it, with ECHO commands

      IE:

      @echo off
      echo command 1>ftp.txt
      echo command 2>>ftp.txt
      echo command 3 %counter%>>ftp.txt
      ftp.exe blah blah correct_switch:ftp.txt


      Does this make sense? Is this suitable?


      --

      Regards,
      Michael


      On Thu, 31 Jan 2002 15:42:06 -0700, "Hammoud, Adam"
      <adam.hammoud@...> wrote:

      >
      >Is there a way to pass an environment variable to an ftp script on NT4?
      >What I am trying to do is set a variable named counter to a value and pass
      >this value to an ftp script.
      >
      >Any help would be greatly appreciated.
      >
      >Regards,
      >
      >Adam
    • Sudeep
      I need to write a script which will automatically attach files & email it. The command to do that is Blat -to test@yahoo.com -attacht -attacht
      Message 2 of 14 , Feb 5, 2002
      • 0 Attachment
        I need to write a script which will automatically attach files & email it.
        The command to do that is
         
        Blat -to test@... -attacht <filename 1> -attacht <filename 2>
         
        Now I have many files in a directory. I want to attach all those files.Therefore i need to construct the above command & then execute
         
        Could anyone help me with this please
        I am running Windows 2000
         
        ----- Original Message -----
        Sent: Friday, February 01, 2002 6:14 AM
        Subject: Re: [BATCH WORLD] RE: Need help with a batch file.


        Assuming the environment variable counter is set then in plain batch you
        can recreate the FTP script, prior to using it, with ECHO commands

        IE:

        @echo off
        echo command 1>ftp.txt
        echo command 2>>ftp.txt
        echo command 3 %counter%>>ftp.txt
        ftp.exe blah blah correct_switch:ftp.txt


        Does this make sense? Is this suitable?


        --

        Regards,
        Michael


        On Thu, 31 Jan 2002 15:42:06 -0700, "Hammoud, Adam"
        <adam.hammoud@...> wrote:

        >
        >Is there a way to pass an environment variable to an ftp script on NT4?
        >What I am trying to do is set a variable named counter to a value and pass
        >this value to an ftp script.
        >
        >Any help would be greatly appreciated.
        >
        >Regards,
        >
        >Adam



        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
        Blat dummy.txt -to test@yahoo.com -attacht *.* On Tue, 5 Feb 2002 09:46:02 -0500, Sudeep
        Message 3 of 14 , Feb 5, 2002
        • 0 Attachment
          Blat dummy.txt -to test@... -attacht *.*

          On Tue, 5 Feb 2002 09:46:02 -0500, "Sudeep" <sudeepchaudhuri@...>
          wrote:

          >I need to write a script which will automatically attach files & email it.
          >The command to do that is
          >
          >Blat -to test@... -attacht <filename 1> -attacht <filename 2>
          >
          >Now I have many files in a directory. I want to attach all those files.Therefore i need to construct the above command & then execute
          >
          >Could anyone help me with this please
          >I am running Windows 2000
        • Sudeep
          Thanks a lot , i did not realize blat supported *.* I have a directory of files .all the files start with a unique 4 character name ie Filenames will be
          Message 4 of 14 , Feb 5, 2002
          • 0 Attachment
            Thanks a lot , i did not realize blat supported  *.*
             
            I have a directory of files .all the files start with a unique 4 character name
            ie Filenames will be AAAA1234, AAAA4567 , BBBB1234
             
            Based on the 4 char name i want to move the files to a certain directory..i.e. if first 4 chars is AAAA then move AAAA* c:\AAAA\today.
             
            I want to go through the directory list & then move all the files.What i was thinking was first create a list of all unique
            4 char name & then going though the list.
             
            how can i create the list & then how do i go though it one by one
             
            i am using Win 2k
            ----- Original Message -----
            Sent: Tuesday, February 05, 2002 10:47 AM
            Subject: Re: [BATCH WORLD] RE: Need help with a batch file.


            Blat dummy.txt -to test@... -attacht *.*

            On Tue, 5 Feb 2002 09:46:02 -0500, "Sudeep" <sudeepchaudhuri@...>
            wrote:

            >I need to write a script which will automatically attach files & email it.
            >The command to do that is
            >
            >Blat -to test@... -attacht <filename 1> -attacht <filename 2>
            >
            >Now I have many files in a directory. I want to attach all those files.Therefore i need to construct the above command & then execute
            >
            >Could anyone help me with this please
            >I am running Windows 2000



            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 Tue, 5 Feb 2002 13:52:28 -0500, Sudeep ... No Worries. BTW, the dummy.txt wasn t directed at you - I am fairly sure that Blat
            Message 5 of 14 , Feb 6, 2002
            • 0 Attachment
              On Tue, 5 Feb 2002 13:52:28 -0500, "Sudeep" <sudeepchaudhuri@...>
              wrote:

              >Thanks a lot , i did not realize blat supported *.*

              No Worries. BTW, the dummy.txt wasn't directed at you - I am fairly sure
              that Blat needs a text file of some kind else it generates an error
              message. Perhaps even a 0 byte file.

              >I have a directory of files .all the files start with a unique 4 character name
              >ie Filenames will be AAAA1234, AAAA4567 , BBBB1234
              >
              >Based on the 4 char name i want to move the files to a certain directory..i.e. if first 4 chars is AAAA then move AAAA* c:\AAAA\today.

              explain the existance of the today directory.


              >I want to go through the directory list & then move all the files.What i was thinking was first create a list of all unique
              >4 char name & then going though the list.
              >
              >how can i create the list & then how do i go though it one by one

              dir /o:n /b>c:\filelist.txt

              >i am using Win 2k

              What limitations are there on third party programs etc?

              --

              Regards,
              Michael
            • Sudeep
              Thanks Michael, I have got this filelist.using your command dir /o:n /b Now how do i go through this.Basically i think it will be some for command by which i
              Message 6 of 14 , Feb 6, 2002
              • 0 Attachment
                Thanks Michael,
                 
                I have got this filelist.using your command dir /o:n /b
                Now how do i go through this.Basically i think it will be some "for" command by which i can go through this list
                 
                There is no restriction on 3rd party programs.
                 
                For the today directory , that directory will always be there under each of the 4 char directories .I do not have to create them .
                 
                it is possible for me to create a list for only the unique 4 char id's
                Your file list works great but is it possible for me to create a filelist having only the first 4 chars of the filenames & also if the list could contain unique names
                 
                i.e I have files AAAA1234, AAAA4567, BBBB1234,BBBB4567
                 
                I want a filelist which contains only AAAA and BBBB
                Then I can go through this list & do
                Copy AAAA* c:\AAAA\today
                 
                Hope u can help me with this
                 
                 
                 
                PS: Blat requires a dummy file even if it is a 0 byte file. I think we can get around it by using blat - -body " " -t test@...
                 
                ----- Original Message -----
                Sent: Wednesday, February 06, 2002 4:53 AM
                Subject: Re: [BATCH WORLD] RE: Need help with a batch file.

                On Tue, 5 Feb 2002 13:52:28 -0500, "Sudeep" <sudeepchaudhuri@...>
                wrote:

                >Thanks a lot , i did not realize blat supported  *.*

                No Worries. BTW, the dummy.txt wasn't directed at you - I am fairly sure
                that Blat needs a text file of some kind else it generates an error
                message.  Perhaps even a 0 byte file.

                >I have a directory of files .all the files start with a unique 4 character name
                >ie Filenames will be AAAA1234, AAAA4567 , BBBB1234
                >
                >Based on the 4 char name i want to move the files to a certain directory..i.e. if first 4 chars is AAAA then move AAAA*  c:\AAAA\today.

                explain the existance of the today directory.


                >I want to go through the directory list & then move all the files.What i was thinking was first create a list of all unique
                >4 char name & then going though the list.
                >
                >how can i create the list & then how do i go though it one by one

                dir /o:n /b>c:\filelist.txt

                >i am using Win 2k

                What limitations are there on third party programs etc?

                --

                Regards,
                Michael



                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
                Save this this basic script to a text file called output.bas and use Qbasic with it in the directory concerned. EG QBASIC /RUN OUTPUT.BAS It is
                Message 7 of 14 , Feb 6, 2002
                • 0 Attachment
                  Save this this basic script to a text file called output.bas and use Qbasic
                  with it in the directory concerned. EG QBASIC /RUN OUTPUT.BAS

                  It is non-destructive and will create a batch file called OUTPUT.BAT
                  containing the required commands. Examine it and test it on a copy of your
                  data to see if it is right for your application.
                  (It also creates a temporary file called !_~_!.001 and uses the system SORT
                  command, in case the directory is too large to be sorted by the internal
                  DIR sort function)

                  All care taken, but owner onus applies.

                  '===========================================================================
                  filespec$ = "*.*"
                  filetemp$ = "!_~_!.001"
                  fileout$ = "output.bat"
                  SHELL "dir " + filespec$ + " /a:-d /b /o:n /-p|sort>" + filetemp$

                  OPEN filetemp$ FOR INPUT AS #1
                  OPEN fileout$ FOR OUTPUT AS #2
                  PRINT #2, "@echo off"
                  DO WHILE NOT EOF(1)
                  LINE INPUT #1, b$: IF LEFT$(a$, 4) = LEFT$(b$, 4) THEN DUP = 1 ELSE DUP = 0
                  IF DUP = 0 THEN
                  PRINT #2, "md "; LEFT$(b$, 4)
                  PRINT #2, "move "; LEFT$(b$, 4); "*.* "; LEFT$(b$, 4)
                  END IF
                  a$ = b$
                  LOOP
                  CLOSE
                  SYSTEM
                  '==============================================================================



                  On Wed, 6 Feb 2002 10:16:15 -0500, "Sudeep" <sudeepchaudhuri@...>
                  wrote:

                  >Thanks Michael,
                  >
                  >I have got this filelist.using your command dir /o:n /b
                  >Now how do i go through this.Basically i think it will be some "for" command by which i can go through this list
                  >
                  >There is no restriction on 3rd party programs.
                  >
                  >For the today directory , that directory will always be there under each of the 4 char directories .I do not have to create them .
                  >
                  >it is possible for me to create a list for only the unique 4 char id's
                  >Your file list works great but is it possible for me to create a filelist having only the first 4 chars of the filenames & also if the list could contain unique names
                  >
                  >i.e I have files AAAA1234, AAAA4567, BBBB1234,BBBB4567
                  >
                  >I want a filelist which contains only AAAA and BBBB
                  >Then I can go through this list & do
                  >Copy AAAA* c:\AAAA\today
                  >
                  >Hope u can help me with this
                  >
                  >
                  >
                  >PS: Blat requires a dummy file even if it is a 0 byte file. I think we can get around it by using blat - -body " " -t test@...
                  >
                  > ----- Original Message -----
                  > From: Michael Marquart
                  > To: batchworld@yahoogroups.com
                  > Sent: Wednesday, February 06, 2002 4:53 AM
                  > Subject: Re: [BATCH WORLD] RE: Need help with a batch file.
                  >
                  >
                  > On Tue, 5 Feb 2002 13:52:28 -0500, "Sudeep" <sudeepchaudhuri@...>
                  > wrote:
                  >
                  > >Thanks a lot , i did not realize blat supported *.*
                  >
                  > No Worries. BTW, the dummy.txt wasn't directed at you - I am fairly sure
                  > that Blat needs a text file of some kind else it generates an error
                  > message. Perhaps even a 0 byte file.
                  >
                  > >I have a directory of files .all the files start with a unique 4 character name
                  > >ie Filenames will be AAAA1234, AAAA4567 , BBBB1234
                  > >
                  > >Based on the 4 char name i want to move the files to a certain directory..i.e. if first 4 chars is AAAA then move AAAA* c:\AAAA\today.
                  >
                  > explain the existance of the today directory.
                  >
                  >
                  > >I want to go through the directory list & then move all the files.What i was thinking was first create a list of all unique
                  > >4 char name & then going though the list.
                  > >
                  > >how can i create the list & then how do i go though it one by one
                  >
                  > dir /o:n /b>c:\filelist.txt
                  >
                  > >i am using Win 2k
                  >
                  > What limitations are there on third party programs etc?
                  >
                • Michael Marquart
                  Sudeep, I didn t read your request closely enough and thought you wished to create the directories too. The following script is quite similar but only copies
                  Message 8 of 14 , Feb 6, 2002
                  • 0 Attachment
                    Sudeep, I didn't read your request closely enough and thought you wished to
                    create the directories too. The following script is quite similar but only
                    copies the appropriate files to "c:\AAAA\today" for example in the batch
                    file.

                    '===========================================================================
                    filespec$ = "*.*"
                    filetemp$ = "!_~_!.001"
                    fileout$ = "output.bat"
                    SHELL "dir " + filespec$ + " /a:-d /b /o:n /-p|sort>" + filetemp$

                    OPEN filetemp$ FOR INPUT AS #1
                    OPEN fileout$ FOR OUTPUT AS #2
                    PRINT #2, "@echo off"
                    DO WHILE NOT EOF(1)
                    LINE INPUT #1, b$: IF LEFT$(a$, 4) = LEFT$(b$, 4) THEN DUP = 1 ELSE DUP = 0
                    IF DUP = 0 THEN
                    PRINT #2, "copy "; LEFT$(b$, 4); "*.* c:\"; LEFT$(b$, 4);"\today"
                    END IF
                    a$ = b$
                    LOOP
                    CLOSE
                    SYSTEM
                    '===========================================================================




                    On Thu, 07 Feb 2002 02:42:08 +1100, Michael Marquart <micm@...>
                    wrote:

                    >
                    >Save this this basic script to a text file called output.bas and use Qbasic
                    >with it in the directory concerned. EG QBASIC /RUN OUTPUT.BAS
                    >
                    >It is non-destructive and will create a batch file called OUTPUT.BAT
                    >containing the required commands. Examine it and test it on a copy of your
                    >data to see if it is right for your application.
                    >(It also creates a temporary file called !_~_!.001 and uses the system SORT
                    >command, in case the directory is too large to be sorted by the internal
                    >DIR sort function)
                    >
                    >All care taken, but owner onus applies.
                    >
                    >
                    >
                    >
                    >On Wed, 6 Feb 2002 10:16:15 -0500, "Sudeep" <sudeepchaudhuri@...>
                    >wrote:
                    >
                    >>Thanks Michael,
                    >>
                    >>I have got this filelist.using your command dir /o:n /b
                    >>Now how do i go through this.Basically i think it will be some "for" command by which i can go through this list
                    >>
                    >>There is no restriction on 3rd party programs.
                    >>
                    >>For the today directory , that directory will always be there under each of the 4 char directories .I do not have to create them .
                    >>
                    >>it is possible for me to create a list for only the unique 4 char id's
                    >>Your file list works great but is it possible for me to create a filelist having only the first 4 chars of the filenames & also if the list could contain unique names
                    >>
                    >>i.e I have files AAAA1234, AAAA4567, BBBB1234,BBBB4567
                    >>
                    >>I want a filelist which contains only AAAA and BBBB
                    >>Then I can go through this list & do
                    >>Copy AAAA* c:\AAAA\today
                    >>
                    >>Hope u can help me with this
                    >>
                    >>
                    >>
                    >>PS: Blat requires a dummy file even if it is a 0 byte file. I think we can get around it by using blat - -body " " -t test@...
                    >>
                    >> ----- Original Message -----
                    >> From: Michael Marquart
                    >> To: batchworld@yahoogroups.com
                    >> Sent: Wednesday, February 06, 2002 4:53 AM
                    >> Subject: Re: [BATCH WORLD] RE: Need help with a batch file.
                    >>
                    >>
                    >> On Tue, 5 Feb 2002 13:52:28 -0500, "Sudeep" <sudeepchaudhuri@...>
                    >> wrote:
                    >>
                    >> >Thanks a lot , i did not realize blat supported *.*
                    >>
                    >> No Worries. BTW, the dummy.txt wasn't directed at you - I am fairly sure
                    >> that Blat needs a text file of some kind else it generates an error
                    >> message. Perhaps even a 0 byte file.
                    >>
                    >> >I have a directory of files .all the files start with a unique 4 character name
                    >> >ie Filenames will be AAAA1234, AAAA4567 , BBBB1234
                    >> >
                    >> >Based on the 4 char name i want to move the files to a certain directory..i.e. if first 4 chars is AAAA then move AAAA* c:\AAAA\today.
                    >>
                    >> explain the existance of the today directory.
                    >>
                    >>
                    >> >I want to go through the directory list & then move all the files.What i was thinking was first create a list of all unique
                    >> >4 char name & then going though the list.
                    >> >
                    >> >how can i create the list & then how do i go though it one by one
                    >>
                    >> dir /o:n /b>c:\filelist.txt
                    >>
                    >> >i am using Win 2k
                    >>
                    >> What limitations are there on third party programs etc?
                  • Michael Marquart
                    Sudeep, I d appreciate some feedback when you ve had time to test the script, to know if it worked or not. On Thu, 07 Feb 2002 03:09:19 +1100, Michael Marquart
                    Message 9 of 14 , Feb 7, 2002
                    • 0 Attachment
                      Sudeep, I'd appreciate some feedback when you've had time to test the
                      script, to know if it worked or not.


                      On Thu, 07 Feb 2002 03:09:19 +1100, Michael Marquart <micm@...>
                      wrote:

                      >The following script is quite similar but only
                      >copies the appropriate files to "c:\AAAA\today" for example in the batch
                      >file.
                    • arun prasad
                      __________________________________________________ Do You Yahoo!? Yahoo! Sports - Coverage of the 2002 Olympic Games http://sports.yahoo.com
                      Message 10 of 14 , Feb 16, 2002
                      • 0 Attachment
                        __________________________________________________
                        Do You Yahoo!?
                        Yahoo! Sports - Coverage of the 2002 Olympic Games
                        http://sports.yahoo.com
                      Your message has been successfully submitted and would be delivered to recipients shortly.