Needing a Batch Script creator program.

K

Kardon Coupé

Hi All,

I'm looking for a program that I don't know if it exsists.

I have some 1739 files that I need to run through another program that
converts it to something else, and as the program needs to be run in DOS (or
Windows XP CMD mode) I'm going to have to do it via a script/text .bat file,
but it will take me forever to type up the script file.. Is there anything
out there, that can ask me a few basics, and create the .bat file for me? or
even run the .bat file within itself..

Hope this makes sense..

Regards.
Paul.

P.s. There is another option... If someone knows how to use .bat files, that
will go through a directory (recursivley) and run the file on the files....
 
M

Micky

Kardon Coupé said:
Hi All,

I'm looking for a program that I don't know if it exsists.

I have some 1739 files that I need to run through another program that converts it to
something else, and as the program needs to be run in DOS (or Windows XP CMD mode) I'm
going to have to do it via a script/text .bat file, but it will take me forever to type up
the script file.. Is there anything out there, that can ask me a few basics, and create the
.bat file for me? or even run the .bat file within itself..

Hope this makes sense..

Regards.
Paul.

P.s. There is another option... If someone knows how to use .bat files, that will go
through a directory (recursivley) and run the file on the files....

Use the FOR command in your batch file.

FOR %variable IN (set) DO command [command-parameters]

Example:

FOR %x IN *.* DO myprog.exe %x

%x represents one file in the set *.*. The file's name is then passed as
an argument to myprog.exe. This is repeated for each file in the set.

Type FOR /? for full syntax info.
 
P

Pegasus \(MVP\)

Kardon Coupé said:
Hi All,

I'm looking for a program that I don't know if it exsists.

I have some 1739 files that I need to run through another program that
converts it to something else, and as the program needs to be run in DOS (or
Windows XP CMD mode) I'm going to have to do it via a script/text .bat file,
but it will take me forever to type up the script file.. Is there anything
out there, that can ask me a few basics, and create the .bat file for me? or
even run the .bat file within itself..

Hope this makes sense..

Regards.
Paul.

P.s. There is another option... If someone knows how to use .bat files, that
will go through a directory (recursivley) and run the file on the files....

You could try something like this:

@echo off
dir /b /s "c:\Some Folder\*.txt" > c:\Files.txt
for /F %%a in (c:\Files.txt) do c:\tools\convert.exe "%%a"
del c:\Files.txt

If this does not make enough sense then you need to be
more specific in what you're trying to achieve. An example
of a command applied to a single file would help.
 
K

Kardon Coupé

Both examples I can see working, and how they work...

The files I want to convert are old .TAP files, which are images of audio
files for a commodore, there is a prorgam called 64tapvoc which converts
these files into .VOC, to be able to play them as audio direct into the
machines tape recorder.

There is one problem I can see happening though, all of the files are not in
8.3 format, and I think the program, running from DOS won't see these files,
I've tried to find a program to convert all the files into 8.3, but I'm
having no luck.

Should I run this bat file, especially the one that gives an output to .txt
file, will the output from the text file be in 8.3 format?

Regards.
Paul.
 
M

Micky

Kardon Coupé said:
Both examples I can see working, and how they work...

The files I want to convert are old .TAP files, which are images of audio files for a
commodore, there is a prorgam called 64tapvoc which converts these files into .VOC, to be
able to play them as audio direct into the machines tape recorder.

There is one problem I can see happening though, all of the files are not in 8.3 format,
and I think the program, running from DOS won't see these files, I've tried to find a
program to convert all the files into 8.3, but I'm having no luck.

Should I run this bat file, especially the one that gives an output to .txt file, will the
output from the text file be in 8.3 format?

No, the /B (bare) format is always in long form.

The /X switch provides 8.3 filenames, but it's mixed in with other
directory data, including the long file name, date, header and footer.
You'd have to filter out all that extra data.

One solution might be as follows (assuming all files are in the folder
C:\taps, including 64tapvoc.exe):

@echo off
dir /x c:\taps\*.tap > c:\taps\files.txt
start /wait notepad c:\taps\files.txt
for /F "tokens=4 delims= " %i in (c:\taps\files.txt) do c:\taps\64tapvoc.exe c:\taps\%i
del c:\taps\files.txt

The pause allows you to manually edit the text file in notepad
to remove the header and footer, leaving just the list of files.
When the file is saved and notepad closed, the batch continues.

The short filename is the fourth token on each line, with each
token delimited by a space (note the single space between the
equal sign and the double quote). The token is then passed to
64tapvoc as %i.

I haven't tried the above with 64tapvoc, so your mileage may
vary...

Note that the author has also provided source code for 64tapvoc.
If you're of a programming bent (or know someone who is), you
could re-write the program to handle long filenames (surrounded
with double quotes), or even recursing through subfolders.

Hope this helps.
 
P

Pegasus \(MVP\)

This should cope with long file names:

@echo off
dir /b /s "c:\Some Folder\*.txt" > c:\Files.txt
for /F "tokens=*" %%* in (c:\Files.txt) do c:\tools\convert.exe "%%*"
del c:\Files.txt
 

Ask a Question

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

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top