Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Need help to create a batch file

Status
Not open for further replies.

itbeginner

Instructor
Mar 28, 2003
58
MU
I have Foxpro 2.6 installation files plus the patches necessary to run it on different versions of windows (win xp and win 98).

I'd like to create a batch file that will allow me to automate the installation of both foxpro and the patch files. (in other words i'll just have to run the batch file and foxpro + the patch files will be installed).

Anybody can please help me?
 
Maybe....what are you having trouble with?

Something like:

Echo Off
Echo Installing, please wait...
REM ****Foxpro installation program******
REM ****including correct path***********
C:\wherever\whatever.exe
Echo Patching, please wait....
REM ****Foxpro patch program*************
REM ****including correct path***********
C:\wherever\someother.exe
Echo Done. Press any key to exit
Pause
 
Hi smah!

Here is the complete code for my batch file. Can you please check it and tell me whether it’s correct? The Foxpro installation goes on correctly but the installation of the patch files does not work. Can you please tell me what’s wrong?

Echo Off
Echo Installing, please wait...

REM *** Foxpro installation program***

d:\foxpro\foxpro26\setup

Echo Copying patch files, please wait

REM *** Copying patch files to foxpro directory***

copy d:\foxpro\patches\IPatchFP.exe c:\fpw26\IPatchFP.exe
copy d:\foxpro\patches\patch2x.exe c:\fpw26\patch2x.exe

REM *** Backing up foxprow.exe and foxw2600.esl in foxpro directory***

CD C:\FPW26

copy foxprow.exe foxprow.old
copy foxw2600.esl foxw2600.old

Echo Patching, please wait...

IPatchFP foxprow.exe
IPatchFP foxw2600.esl
patch2x foxprow.exe
patch2x foxw2600.esl

Echo Done. Press any key to exit
Pause
 
So, this works:
copy foxprow.exe foxprow.old
copy foxw2600.esl foxw2600.old


And some or all of this fails:
IPatchFP foxprow.exe
IPatchFP foxw2600.esl
patch2x foxprow.exe
patch2x foxw2600.esl


Is my interpretation correct?


What is IPatchFP? What is patch2x? Are these executable programs that can have an optional parameter? Are both located in the C:\FPW26 directory? What error do you get if you run those commands manually from within C:\FPW26?
 
If you type "IPatchFP foxprow.exe" in a dos window does the program return you to a dos prompt when it is done?
 
changes in boldface

REM *** Foxpro installation program***

+++ change in this line, missing CD. Plus, not needed.
REM d:\foxpro\foxpro26\setup


Echo Copying patch files, please wait

REM *** Copying patch files to foxpro directory***

copy d:\foxpro\patches\IPatchFP.exe c:\fpw26\IPatchFP.exe
copy d:\foxpro\patches\patch2x.exe c:\fpw26\patch2x.exe

REM *** Backing up foxprow.exe and foxw2600.esl in foxpro directory***

+++ Note: missing drive change reference. Need to change to c: even if directory pointer moved:

C:


CD C:\FPW26

copy foxprow.exe foxprow.old
copy foxw2600.esl foxw2600.old

Echo Patching, please wait...

IPatchFP foxprow.exe
IPatchFP foxw2600.esl
patch2x foxprow.exe
patch2x foxw2600.esl

Echo Done. Press any key to exit
Pause
 
bcastner, here's where I have to ask a couple of questions because maybe I'm missing something.

How does the main program initially get installed if not for: d:\foxpro\foxpro26\setup ?

How do you know that the working drive letter is not C and needs to be changed back? I didn't see any commands that could not be entered directly from the C: prompt.

Another bit of info for itbeginner that I found when re-reading:
Code:
copy d:\foxpro\patches\IPatchFP.exe c:\fpw26\IPatchFP.exe
copy d:\foxpro\patches\patch2x.exe c:\fpw26\patch2x.exe
could be:
copy d:\foxpro\patches\IPatchFP.exe c:\fpw26
copy d:\foxpro\patches\patch2x.exe c:\fpw26

There's nothing wrong with specifying the destination file name (especially if you want to change it), but in this case, it allows for an additional place to make a typo. If the destination filename is not specified, the source filename will be used.

And now that I have re-read this, I found the answer to my earlier questions: What is IPatchFP? What is patch2x? So, nevermind that part.
 
smah,

Ok, I understand the first line better.

But the only way I can see it failing is by the drive letter not being C, and requiring its specification, as I do in the second change.

 
We're on a similar wavelength - I also suspect a path related problem, but not the drive letter.
 
Hello to all!

The problem was as specified by bcastner. I missed the C: drive specification. When i added it, it worked allright.

Thx a lot to you all for ur precious suggestions.
 
I will make a note on my little chalkboard:

smah: 50 bcastner: 1
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top