dBASE III 管理员安装失败,“goto was unexpected”
Posted
技术标签:
【中文标题】dBASE III 管理员安装失败,“goto was unexpected”【英文标题】:Install fails for dBASE III Administrator, "goto was unexpected" 【发布时间】:2016-08-12 08:39:47 【问题描述】:我是我家族拥有的房地产金融业务的新手程序员/IT 人员。长话短说,大约 25-30 年前,我们创建了一个基于 dBASE III 的应用程序系统来跟踪所有客户帐户。更改为现代系统的成本将是天文数字,因为我可以以合理的效率编码,所以我们保留它。没问题,但每个人都在不同的工作站上使用单个用户版本。我想安装 dBASE 管理员并将其更改为网络环境。我想进入它我会有点超出我的深度,但能够完成它。我目前在 Windows XP 系统上运行它,没有互联网连接,所有这些都只是 LANd 在一起。
我从 vetusware 获得了安装磁盘映像。我通过虚拟软盘安装了图像。在命令提示符下,我导航到磁盘并按照手册中的说明进行操作:
在驱动器 A 中插入系统盘 #1。 通过键入 A:[return] 将默认驱动器更改为 A
到目前为止一切顺利...我有一个 A 提示。
然后输入: A> 安装 C: DBA
我键入“INSTALL C: DBA”,它启动了在磁盘上找到的“INSTALL.BAT”,但很快报告“此时 goto 是意外的”。并将我返回到 A 提示符。
我将在下面发布批处理文件文本。执行时,它会显示以“...previous version of dBASE”结尾的“回显”文本的顶部。但是下一行是“goto was unexpected...”
这似乎是 INSTALL 批处理文件有问题,而我没有做任何事情......我知道这是一个批处理文件错误,而不是程序内部的错误。同样奇怪的是,该程序提到了这个 DBA.COM,并且在任何磁盘上都找不到它......任何人都可以提供的任何帮助或指导将不胜感激。
非常感谢,
克里斯
echo off
cls
echo
echo dBASE III PLUS VERSION 1.1
echo HARD DISK INSTALLATION
echo
echo You can copy dBASE III PLUS to your hard disk by following
echo these installation instructions. You can also use these
echo instructions to install dBASE ADMINISTRATOR.
echo
echo If you want to save a previously installed version of dBASE,
echo uninstall it using that version's UNINSTAL program.
echo
echo If you choose not to save a previous version, install dBASE
echo III PLUS Version 1.1 into the same directory. This will auto-
echo matically erase the previous version of dBASE.
echo
if "%1==" goto Helpinst
for %%f in (C:,c:,D:,d:,E:,e:,F:,f:,G:,g:,H:,h:,Y:,y:) do if %1.==%%f. goto START
for %%f in (I:,i:,J:,j:,K:,k:,L:,l:,M:,m:,N:,n:,O:,o:,P:,p:,Z:,z:) do if %1.==%%f. goto START
for %%f in (Q:,q:,R:,r:,S:,s:,T:,t:,U:,u:,V:,v:,W:,w:,X:,x:) do if %1.==%%f. goto START
goto BADDRIVE
:START
if "==%2" goto DBASE
if %2.==DBA. goto DBA
if %2.==dba. goto DBA
goto Helpinst
:DBASE
echo dBASE III PLUS will be installed on drive %1
echo
yn Y N 30 Do you want to continue (Y/N)?
if ERRORLEVEL 1 goto DBASE1
goto END
:DBASE1
if exist dbase.lod goto ID
if exist %1dbase.exe goto ErrExist
if exist %1dba.com goto ERREXT
if not exist id.exe goto MISS
%1
a:id /S
a:
echo Copying files to drive %1 . . .
echo
copy dbase.exe %1
copy dbaseinl.ovl %1
copy dbase.msg %1
if not exist %1config.db copy config.db %1
if not exist %1config.sys copy config.sys %1
:SYS2
echo
echo Insert the dBASE III PLUS System Disk #2 in drive A.
echo
pause
if not exist dbase.ovl goto SYS2
echo
echo Copying files to drive %1 . . .
echo
copy dbase.ovl %1
copy help.dbs %1
copy assist.hlp %1
if not exist %1dbase.ovl goto ErrDbase
if not exist %1dbase.exe goto ErrDbase
if not exist %1dbase.msg goto ErrDbase
if not exist %1dbaseinl.ovl goto ErrDbase
echo
echo dBASE III PLUS has been successfully installed.
goto End
:DBA
echo dBASE ADMINISTRATOR will be installed on drive %1
echo
yn Y N 30 Do you want to continue (Y/N)?
if ERRORLEVEL 1 goto Ad1
goto END
:Ad1
if exist dba.lod goto GETSYS1
if exist %1dba.com goto ERREXT
if exist %1dbase.exe goto ErrExist
if not exist dbaseinl.ovl goto GETSYS1
echo
echo Copying files to drive %1 . . .
echo
copy help.dbs %1
echo
:AD2
echo
echo Insert the Administrator #1 disk in drive A
echo
pause
echo
if not exist dba.lod goto AD2
:AD3
if exist installh.sg3 goto INITDBA
if not exist idlan.exe goto MISS
%1
a:idlan /M
a:
installh p=a t=%1
if ERRORLEVEL 1 goto ErrDBA
echo
copy dba.lod %1\dbnetctl.300
copy dbase.msg %1
copy protect.exe %1
copy assist.hlp %1
echo
:Ad4
echo
echo Insert the Administrator #2 disk in drive A
echo
pause
echo
if not exist dba.ovl goto AD4
echo Copying files to drive %1 . . .
echo
copy dba.ovl %1
copy adduser.com %1
echo
echo dBASE ADMINISTRATOR has been successfully installed
echo
echo One user may now run dBASE ADMINISTRATOR. To add more users,
echo run the ADDUSER program. The ADDUSER program is located in
echo the directory in which dBASE ADMINISTRATOR is installed.
echo
goto END
:Helpinst
echo You entered the command incorrectly. The correct syntax is:
echo
echo "INSTALL <drive:>" To install dBASE III PLUS.
echo
echo "INSTALL <drive:> DBA" To install dBASE ADMINISTRATOR.
echo
echo Install is aborted.
goto End
:ErrExist
echo
echo dBASE III PLUS already exists in the destination drive.
goto ErrUnst
:ERREXT
echo
echo dBASE ADMINISTRATOR already exists in the destination drive.
:ErrUnst
echo
echo Install is aborted.
goto End
:BADDRIVE
echo
echo Invalid drive letter specified. Install is aborted.
goto Helpinst
:ErrDbase
echo
echo dBASE III PLUS is not installed. Install is aborted.
goto END
:MISS
echo
echo Your system disk has missing files. Install is aborted.
echo
goto DELFILE
:ID
echo
echo dBASE III PLUS has not been identified. Please run ID.
echo
goto END
:INITDBA
echo
echo dBASE ADMINISTRATOR has not been identified. Please run IDLAN.
echo
goto DELFILE
:GETSYS1
echo
echo Please use the dBASE III PLUS System Disk #1 to run the installation.
echo Install is aborted.
echo
goto END
:ErrDBA
echo
echo dBASE ADMINISTRATOR installation has been aborted.
echo
:DELFILE
if exist %1help.dbs del %1help.dbs
:End
【问题讨论】:
1.在将来提问之前阅读此帮助主题:How to create a Minimal, Complete, and Verifiable example。 2.删除echo off
进行调试! 3. 对于区分大小写的比较,请使用if /I
。 4、没有原生的yn
命令,是不是外接工具?否则请查看choice
命令。
尝试输入command
,然后按照说明操作。
@aschipfl YN.EXE 是(曾经是?)一个外部程序,它是 DBase III+ 的一部分
您可以在命令提示符窗口中运行批处理文件,将第一行更改为echo on
,以查看批处理文件在哪一行失败。 if "==%2" goto DBASE
绝对不正确。我想这一行应该是if ""=="%~2" goto DBASE
,即在调用它时检查是否没有第二个参数传递给批处理文件,在这种情况下继续标签DBASE
。
谢谢大家的帮助,对不起,我违反了一些习俗。调试它我最终移除了几行 @Mofi 提到的几行,并且能够继续安装。我现在走得更远了,但遇到了另一个障碍。我之前提到过,我似乎无法找到这个 DBA.COM 文件,并且在尝试运行 Adduser 程序时它给了我一个错误。我会继续前进,看看我是否找不到该文件应该在哪里......或者如何获得它......再次感谢!
【参考方案1】:
您的问题是安装脚本是为 MS-DOS 命令解释器 (COMMAND.COM
) 编写的,与 Windows XP 命令解释器 (cmd.exe
) 不兼容。具体问题是 XP 解释器赋予双引号字符 (") 特殊含义,而 MS-DOS 解释器没有。这导致以下行在 XP 下被不同地解释为错误:
if "%1==" goto Helpinst
我不建议尝试将脚本“修复”为与 Windows XP 兼容。除了必须修复许多这样的行之外,还有一个更简单的解决方案。只需使用 MS-DOS 命令解释器。您可以通过在命令提示符处输入command
来执行此操作。然后像往常一样按照说明进行操作。例如:
command
a:
install c: dba
【讨论】:
以上是关于dBASE III 管理员安装失败,“goto was unexpected”的主要内容,如果未能解决你的问题,请参考以下文章
ArcMap中Shapefile和dBASE文件的创建与管理