running rebuild.exe in a .bat file

G

Guest

We reorganize our indexed files once a month and we just upgraded to XP
Professional. When we run the Batch file with the reorg in it, the file we
want to reorg is gone. Below is the code we use in the batch file. Can't
this be done in XP?

@ECHO OFF
ECHO ***********************
ECHO * REORGANIZE MCIIFILE *
ECHO ***********************
E:
CD\MCC-MF
REBUILD E:\MCC-DATA\MOLINE\MCIIFILE,E:\MCC-DATA\MOLINE\MCIIFILX /I /V
ECHO **************************************************
ECHO * REORGANIZE COMPLETE - CHECK FOR ERROR MESSAGES *
ECHO **************************************************
PAUSE
DEL E:\MCC-DATA\MOLINE\MCIIFILE.*
RENAME E:\MCC-DATA\MOLINE\MCIIFILX MCIIFILE
RENAME E:\MCC-DATA\MOLINE\MCIIFILX.IDX MCIIFILE.IDX

thanks
cathy
 
N

neil

You can run batch files in XP so if the program you have is XP compatible
then it should work. Where does "rebuild.exe" come from it doesn't seem to
be a windows XP file. I suspect the batch file is deleting the file without
the EXE being run, did you check this before the upgrade.

Neil
 
V

Vanguard \(NPI\)

Cathy said:
We reorganize our indexed files once a month and we just upgraded to XP
Professional. When we run the Batch file with the reorg in it, the file
we
want to reorg is gone. Below is the code we use in the batch file. Can't
this be done in XP?

@ECHO OFF
ECHO ***********************
ECHO * REORGANIZE MCIIFILE *
ECHO ***********************
E:
CD\MCC-MF
REBUILD E:\MCC-DATA\MOLINE\MCIIFILE,E:\MCC-DATA\MOLINE\MCIIFILX /I /V
ECHO **************************************************
ECHO * REORGANIZE COMPLETE - CHECK FOR ERROR MESSAGES *
ECHO **************************************************
PAUSE
DEL E:\MCC-DATA\MOLINE\MCIIFILE.*
RENAME E:\MCC-DATA\MOLINE\MCIIFILX MCIIFILE
RENAME E:\MCC-DATA\MOLINE\MCIIFILX.IDX MCIIFILE.IDX

I didn't find rebuild.exe on either of my Windows 2000 Pro or Windows XP Pro
hosts. You never mentioned *from* WHICH version you migrated to Windows XP.
Guess you'll have to install the program for whatever software product to
which it belongs. I don't know what rebuild.exe is supposed to do. It is
possible it issues its own commands in another DOS shell but assumes the
command syntax available with the old command-line intrepeter (command.com)
instead of the new one (cmd.exe) which gets used by default. You could try
to run "command /c yourfile.bat" to see if it then works. It may also only
work under whatever old version Windows that you used that you never
mentioned. In that case, use the compatibility mode in the properties of
the shortcut that you create to run this .bat file.

Although "CD\MCC-MF" will work, personally I prefer to use the standard
syntax of "CD \MCC-MF" (i.e., with the space delimiter) rather than rely on
the command interpreter's parser to catch the next token by the use of an
illegal progname character.

What is the std output when you run the .bat file in a DOS shell? Run it as
"yourfile.bat > yourfile.log" and look in the logfile to see if there are
error messages. You might also want to REM out the @ECHO OFF line so that
you can actually see what each line does and its output.
 
G

Guest

This batch file takes an indexed file and rebuilds the index. These are
large files that get broken up during everyday adds, changes, and deletes.
Our cobol programs sometimes have problems with a file if periodic
maintenance is not done on it. The rebuild.exe probably dates back to msdos
6.1. We've had no problems running it on Win 2000 professional computers,
but XP doesn't like it and it bypasses the rebuild line and deletes the file.
We can see the file information as it is being rebuilt because of the /v
switch. We'll have to look into a third party product possibly if we can't
get a solution to this.
Thanks
 
V

Vanguard \(NPI\)

Cathy said:
This batch file takes an indexed file and rebuilds the index. These are
large files that get broken up during everyday adds, changes, and deletes.
Our cobol programs sometimes have problems with a file if periodic
maintenance is not done on it. The rebuild.exe probably dates back to
msdos
6.1. We've had no problems running it on Win 2000 professional computers,
but XP doesn't like it and it bypasses the rebuild line and deletes the
file.
We can see the file information as it is being rebuilt because of the /v
switch. We'll have to look into a third party product possibly if we
can't
get a solution to this.


Did you *try* the compatibility mode mentioned? Since it is a really old
DOS-mode program, you might have to run it under a shell configured for old
compatibility rules. Define a shortcut to the .bat file and set the
compatibility appropriate for the program(s) called by the .bat file.
 
V

Vanguard \(NPI\)

Cathy said:
The rebuild.exe is an older version. Where would I find a rebuild.exe for
XP?


Well, where did you get it before? It isn't included with your old COBOL
program? It isn't a utility used with whatever database or the product that
creates the indexed files you are using? rebuild.exe is NOT a program
included in MS-DOS or in any version of Windows. Whatever creates those
indexed files is probably from where you got the rebuild utility.
 

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