I need help with .bat script

Discussion in 'ASP .Net Security' started by Lucas Cowald, Oct 27, 2003.

  1. Lucas Cowald

    Lucas Cowald Guest

    Hi, I have no idea how to write .bat scripts, can you help me write one?
    Here is a pseudo code of what I would like the .bat script do.

    For intFolder = 1 to 100
    For intFileNumber = 1 to 20
    IF intFileNumber.wmv file does not exist, THEN exit loop.
    sse45.exe -i k:\o\intFileNumber.wmv -o k:\o\intFileNumber.shh -w
    128 -df 0 -m 2 -p
    Next
    Next

    I need to use this script to run sse45.exe program that will convert files
    in one format to another. I have about 100 folders that contain around 20
    files in each folder. The files are numbered as consecutive integers
    starting with number 1 (example: 1.wmv, 2.wmv, 3.wmv, .....). Folders are
    also numbered from 1 to 100.

    Would you be so kind and write me a .bat script that would do the job of my
    pseudocode above?
    Thank you in advance,
    Lucas Cowald.
    Lucas Cowald, Oct 27, 2003
    #1
    1. Advertising

  2. Lucas Cowald

    1SALz Guest

    Wrong newsgroup ...
    Check forfiles.exe in windows reskit cd.

    "Lucas Cowald" <> wrote in message
    news:...
    > Hi, I have no idea how to write .bat scripts, can you help me write one?
    > Here is a pseudo code of what I would like the .bat script do.
    >
    > For intFolder = 1 to 100
    > For intFileNumber = 1 to 20
    > IF intFileNumber.wmv file does not exist, THEN exit loop.
    > sse45.exe -i k:\o\intFileNumber.wmv -o k:\o\intFileNumber.shh -w
    > 128 -df 0 -m 2 -p
    > Next
    > Next
    >
    > I need to use this script to run sse45.exe program that will convert files
    > in one format to another. I have about 100 folders that contain around

    20
    > files in each folder. The files are numbered as consecutive integers
    > starting with number 1 (example: 1.wmv, 2.wmv, 3.wmv, .....). Folders are
    > also numbered from 1 to 100.
    >
    > Would you be so kind and write me a .bat script that would do the job of

    my
    > pseudocode above?
    > Thank you in advance,
    > Lucas Cowald.
    >
    >
    1SALz, Oct 28, 2003
    #2
    1. Advertising

  3. Lucas Cowald

    Steve Jansen Guest

    You posted to the wrong group...next time try the group alt.msdos.batch

    Anyways, this script will do what you want on NT, W2K, XP, and 2003 server.

    --- START ---
    :: enumerate subdirectories in current path
    FOR /R /D %I IN (*) DO (
    @ ECHO Processing directory "%~fI"

    :: enumerate files in directory
    FOR %J IN ("%~fI\*.wmv") DO (
    @ ECHO Processing wmv file "%~fJ"
    IF EXIST %J.wmv ( sse45.exe -i "%~fJ" -o "%~pJ.ssh" -w 128 -df 0 -m -p )
    )
    )
    --- END ---

    Substitute %%I for %I and %%J for %J if you plan to use in a batch file
    (.bat or .cmd file).

    FOR /? will give you reference documentation on the use of this command.

    -Steve Jansen

    Lucas Cowald wrote:
    > Hi, I have no idea how to write .bat scripts, can you help me write one?
    > Here is a pseudo code of what I would like the .bat script do.
    >
    > For intFolder = 1 to 100
    > For intFileNumber = 1 to 20
    > IF intFileNumber.wmv file does not exist, THEN exit loop.
    > sse45.exe -i k:\o\intFileNumber.wmv -o k:\o\intFileNumber.shh -w
    > 128 -df 0 -m 2 -p
    > Next
    > Next
    >
    > I need to use this script to run sse45.exe program that will convert files
    > in one format to another. I have about 100 folders that contain around 20
    > files in each folder. The files are numbered as consecutive integers
    > starting with number 1 (example: 1.wmv, 2.wmv, 3.wmv, .....). Folders are
    > also numbered from 1 to 100.
    >
    > Would you be so kind and write me a .bat script that would do the job of my
    > pseudocode above?
    > Thank you in advance,
    > Lucas Cowald.
    >
    >
    Steve Jansen, Nov 3, 2003
    #3
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Lucas Cowald

    I need help with .bat script

    Lucas Cowald, Oct 27, 2003, in forum: ASP .Net
    Replies:
    1
    Views:
    316
    Hans Kesting
    Oct 27, 2003
  2. Lucas Cowald

    I need help with .bat script

    Lucas Cowald, Oct 27, 2003, in forum: ASP .Net Building Controls
    Replies:
    1
    Views:
    104
  3. Lucas Cowald

    I need help with .bat script

    Lucas Cowald, Oct 27, 2003, in forum: ASP .Net Datagrid Control
    Replies:
    0
    Views:
    58
    Lucas Cowald
    Oct 27, 2003
  4. Lucas Cowald

    I need help with .bat script

    Lucas Cowald, Oct 27, 2003, in forum: ASP .Net Mobile
    Replies:
    0
    Views:
    109
    Lucas Cowald
    Oct 27, 2003
  5. Lucas Cowald

    I need help with .bat script

    Lucas Cowald, Oct 27, 2003, in forum: ASP .Net Web Controls
    Replies:
    0
    Views:
    71
    Lucas Cowald
    Oct 27, 2003
Loading...

Share This Page