Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > ASP .Net Security > I need help with .bat script

Reply
Thread Tools

I need help with .bat script

 
 
Lucas Cowald
Guest
Posts: n/a
 
      10-27-2003
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.


 
Reply With Quote
 
 
 
 
1SALz
Guest
Posts: n/a
 
      10-28-2003
Wrong newsgroup ...
Check forfiles.exe in windows reskit cd.

"Lucas Cowald" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
> 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.
>
>



 
Reply With Quote
 
 
 
 
Steve Jansen
Guest
Posts: n/a
 
      11-03-2003
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.
>
>


 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
How to execute a script from another script and other script does notdo busy wait. Rajat Python 3 01-08-2010 02:05 PM
RE: How to execute a script from another script and other script doesnotdo busy wait. VYAS ASHISH M-NTB837 Python 2 01-07-2010 08:18 PM
Need help converting 'onclick' script to 'href' script... whitgurley@gmail.com Javascript 9 12-30-2006 11:50 PM
Newby question - need a script to stop another script Steve Henderson Javascript 2 10-09-2003 04:53 AM
Perl Help - Windows Perl script accessing a Unix perl Script dpackwood Perl 3 09-30-2003 02:56 AM



Advertisments