使用主机从 oracle 表单 6i 运行批处理文件

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/1500802/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-09-18 19:07:01  来源:igfitidea点击:

running a batch file from oracle forms 6i using host

oracleformsbatch-file

提问by berto77

I am trying to run a batch file. the file is located here:

我正在尝试运行批处理文件。该文件位于此处:

C:\Program Files\Java\jre6\bin\getfile.bat

I use this in oracle forms 6i: first i assign this path to a variable:

我在 oracle forms 6i 中使用它:首先我将此路径分配给一个变量:

tmp_msg := 'C:\Program Files\Java\jre6\bin\getfile.bat'

then I use the host command:

然后我使用主机命令:

host( 'cmd /c' || tmp_msg, no_screen);

This is exactly as I have it. It doesn't give me an error, but I don't get the result that I'm expecting. I'm actually executing java code in the batch file like so: java -classpath path;addedpackage.jar myClass

这正是我所拥有的。它没有给我一个错误,但我没有得到我期望的结果。我实际上是在批处理文件中执行 java 代码,如下所示: java -classpath path; addedpackage.jar myClass

I hope someone can help me with this. Thank you.

我希望有人能帮我解决这个问题。谢谢你。

采纳答案by berto77

I got the command to work. The reason it wasn't working was because the function (block) i had it in wasn't getting executed. Oracle forms are sometimes tricky. this worked: host(tmp_msg);

我得到了工作的命令。它不工作的原因是因为我拥有它的函数(块)没有被执行。Oracle 表单有时很棘手。这有效:主机(tmp_msg);

回答by AndyDan

It looks like you need a space after /c:

看起来您在 /c 之后需要一个空格:

host( 'cmd /c ' || tmp_msg, no_screen);

回答by nasreen

you need to use command like this

你需要使用这样的命令

host('cmd /c start '||filename, no_screen);