Re: Please help me with a batch file.

From: Al Dunbar [MS-MVP] (alan-no-drub-spam_at_hotmail.com)
Date: 12/11/04

  • Next message: David Candy: "Re: Please help me with a batch file."
    Date: Fri, 10 Dec 2004 23:01:31 -0700
    
    

    Brilliant! So brilliant, in fact, that I provided a nearly identical
    solution in another newsgroup where the OP cross-posted.

    /Al

    "David Candy" <.> wrote in message
    news:ehvKckp3EHA.1192@tk2msftngp13.phx.gbl...
    While one could take the approach you describe it is easier to process all
    files in a directory.

    For %%A in (X:\inputfolder\*.*) Do "C:\program.exe" -i "%%A" -o
    "X:\outputfolder\%%~nxA"

    This should work but I can't test. Type For /? for help. The for command can
    count too so you can use it with your original approach.

    Just type the full pathname to run the file. EG if you put it in C:

    c:\mybatchfile.bat

    Drag it into the command prompt or Start Run box and it will type the name
    for you.

    You can skip the batchfile by placing this in a shortcut

    cmd /k For %A in (X:\inputfolder\*.*) Do "C:\program.exe" -i "%A" -o
    "X:\outputfolder\%~nxA"

    Note %A if typing or %%A if in a bat file. Change the /k to /c if you want
    the window to close when finished.

    Type for /? and cmd /? for help (or look it up is Help and Support which is
    a bit more detailed).

    -- 
    ----------------------------------------------------------
    http://www.uscricket.com
    "Sandy Kaminski" <Sandy777888@yahoo.com> wrote in message
    news:O--dnROLkbIowCTcRVn-jw@comcast.com...
    > Hi, I am using MS Windows 2000. I need to write a batch file for video
    > encoding and I don't have any experience in writting Command prompt or
    batch
    > programs. Could you help me with this small batch program. Here is what I
    > want to do:
    > The video files to encode are in folder called: "inputfolder". The folder
    to
    > store files after they are encoded is called "outputfolder". There are 100
    > files to encode in "inputfolder". I want to write a batch that would
    encode
    > all 100 files in a loop. The name of each videofile in "inputfolder"
    differs
    > from one another with a number in the end of file name. For example:
    > videofile-1, videofile-2, videofile-3, videofile-4,...., videofile-100. I
    > wanted to put the encoding statements into a loop, and use the value of
    the
    > loop variable "AAA" (see below) to substitute for videofile number:
    > videofile-AAA.
    >
    > 1. Could you help me write a correct code to use in a batch file?
    >
    > For AAA = 1 to 100
    > C:\program.exe -i X:\inputfolder\videofile-"AAA".avi -o
    > X:\outputfolder\videofile-"AAA".avi
    > Next
    >
    > 2. Can you also tell me how to call this batch file from the command
    prompt
    > window?
    >
    > Thank you very much for your help.
    >
    > Sandy
    >
    >
    

  • Next message: David Candy: "Re: Please help me with a batch file."

    Relevant Pages

    • Re: Please help me with a batch file.
      ... The way I did the batch file, ... > ..and I run it from teh command prompt window by typing: X:\mybatchfile.bat. ... > the window to close when finished. ... >> The video files to encode are in folder called: ...
      (microsoft.public.win2000.cmdprompt.admin)
    • Re: Please help me with a batch file.
      ... So brilliant, in fact, that I provided a nearly identical ... > Drag it into the command prompt or Start Run box and it will type the name ... >> The video files to encode are in folder called: ... Could you help me write a correct code to use in a batch file? ...
      (microsoft.public.win2000.cmdprompt.admin)
    • Re: Please help me with a batch file.
      ... Drag it into the command prompt or Start Run box and it will type the name for you. ... > The video files to encode are in folder called: ... The name of each videofile in "inputfolder" differs ... Could you help me write a correct code to use in a batch file? ...
      (microsoft.public.win2000.cmdprompt.admin)
    • Re: Application starts too soon
      ... The application runs froma a batch file. ... The batch file has my exe followed by a Shutdown command ... think the app tries to run, encounters an error, and exits. ... the app runs fine if I manually launch it after the command prompt ...
      (microsoft.public.windowsxp.embedded)
    • Re: DOS Environment not working
      ... It just shows the variables set by windows on startup, ... The batch file does not fail because I ... installed a errorlevel statement to echo a message.... ... I run the batchfile at the command prompt, but when I check the variables: ...
      (microsoft.public.windowsxp.general)