Problem using Host command to call a batch file

Hi all,
I am trying to call a batch file with the Host command:
host c:\test\u.bat
where u.bat calls unix2dos.exe with a parameter of d_unix.txt.
Bat file looks like this:
C:\test\unix2dos.exe d_unix.txt
PAUSE
The bat file gets called fine, but the following error occurs (in the cmd prompt):
T:\globals\ORACLE8\bin>C:\test\unix2dos.exe d_unix.txt
d_unix.txt:
Can't open file
T:\globals\ORACLE8\bin>PAUSE
Press any key to continue . . .
Running the batch file directly in windows works fine. The batch file also runs fine from the Host command if I remove the d_unix.txt parameter.
The file d_unix.txt file is in the same directory as the batch file and as unix2dos.exe.
Running from Sql Plus in a windows environment.
Any thoughts?
Edited by: dgouin on Aug 19, 2009 11:41 AM
Edited by: dgouin on Aug 19, 2009 11:42 AM
Edited by: dgouin on Aug 19, 2009 11:42 AM

I always understood that it worked with whatever directory you were in when you launched the SQL*Plus binary:
D:\>SQLPLUS dbuser@testdb
SQL*Plus: Release 10.2.0.4.0 - Production on Wed Aug 19 15:26:35 2009
Copyright (c) 1982, 2007, Oracle.  All Rights Reserved.
Enter password:
Connected to:
Oracle Database 10g Enterprise Edition Release 10.2.0.4.0 - Production
With the Partitioning, OLAP, Data Mining and Real Application Testing options
dbuser@testdb > HOST ECHO %CD%
D:\
dbuser@testdb > exit
Disconnected from Oracle Database 10g Enterprise Edition Release 10.2.0.4.0 - Production
With the Partitioning, OLAP, Data Mining and Real Application Testing options
D:\>H:
H:\>SQLPLUS dbuser@testdb
SQL*Plus: Release 10.2.0.4.0 - Production on Wed Aug 19 15:27:03 2009
Copyright (c) 1982, 2007, Oracle.  All Rights Reserved.
Enter password:
Connected to:
Oracle Database 10g Enterprise Edition Release 10.2.0.4.0 - Production
With the Partitioning, OLAP, Data Mining and Real Application Testing options
dbuser@testdb > HOST ECHO %CD%
H:\
dbuser@testdb > exit
Disconnected from Oracle Database 10g Enterprise Edition Release 10.2.0.4.0 - Production
With the Partitioning, OLAP, Data Mining and Real Application Testing options

Similar Messages

  • When use host command to call discoverer

    hi all
    i am using the host command in forms 6i to call open
    the discoverer by command line . its fine and works well
    but the discoverer locks the screen and i cant work with both of them so i have to close the discoverer and i cant leave it open .
    can solve this problem ?

    Use API d2kwutil
    PROCEDURE proc_call_disc IS
    declare
    nm_command varchar2(10000);
    nm_user varchar2(20);
    pw_user varchar2(20);
    cn_user varchar2(20);
    BEGIN
    nm_user := get_application_property( username );
    pw_user := get_application_property( password );
    cn_user := get_application_property( connect_string );
    nm_command := 'dis4usr /connect ' || nm_user || '/' || pw_user || '@' || cn_user||' /opendb "owner.'||v_nome_bis||'" /sheet '||v_sheet||' '||string_parametros;
    win_api_shell.winexec(nm_command, WIN_API.SW_SHOWMAXIMIZED, false);
    END;

  • Calling SQL Loader from Forms 4.5 using HOST command in Win2000

    One of my forms calls SQL Loader 7.3 using HOST command to load a csv file onto the database(Oracle 7.3) under Windows 2000 platform.
    Only after sql loader finishes its operation the control should come to my form i.e. synchronous execution.
    As of now its running asynchronously.
    Is there any way to make it synchronous. If Not any other work arounds?
    Environment Details
    Forms [32 Bit] Version 4.5.10.6.0 (Production)
    Windows 2000 Operating System
    Oracle7 Release 7.3.2.3.2

    Forms6i running on W2000, Rdbms 8.1.7
    in Forms I added a button TEST,
    Trigger when-button-pressed : host('test.bat') ;
    in directory .......\frm I added file test.bat :
    REM ===============
    cd /d C:\........\ldr
    pause
    sqlldr parfile=test.par
    pause
    type test.log
    pause
    exit
    REM ================
    now, pressing TEST button opens DOS window, telling me what's going on, running sqlldr, finally going back to forms
    Are you using NO_PROMPT or NO_SCREEN option of HOST command ?
    Had a look at Forms 4.5 manuals, there is no mentioning of (a)synchronously operation in connection with HOST command.

  • Calling SQL Loader using HOST command from Developer Forms 4.5

    I want to execute a set of code from D2K Forms 4.5 which has interfface with Client - OS ( In my case Windows NT/XP). I want to execute SQL Loader from Forms using Host Command and then after completion of that process, I want to do next transcations ( depending upond success of HOST/SQL Loader).
    How to achive this?
    I tried writing code like this ...
    l_vc_command := 'sqlldr73'
                        ||' USERID='||l_vc_username||'/'||l_vc_password||'@'||l_vc_connect_string
                        ||' CONTROL='||l_vc_filepath||'Upload.ctl'
                        ||' DATA='||LTRIM(RTRIM(l_vc_fileloc))
                        ||' LOG='||l_vc_filepath|| l_vc_log_file || '_' || l_dt_sysdate_str ||'.log'                    
                        ||' BAD='||l_vc_filepath|| l_vc_bad_file || '_' || l_dt_sysdate_str ||'.bad'
                        ||' DISCARD='||l_vc_filepath|| l_vc_discard_file || '_' || l_dt_sysdate_str ||'.dsc';
    HOST(l_vc_command,NO_PROMPT);
    After this command i want to do some other code execution. so even if it fails or success, next code is executed. How to control this?
    Please help..
    Regards,
    Milind

    Forms6i running on W2000, Rdbms 8.1.7
    in Forms I added a button TEST,
    Trigger when-button-pressed : host('test.bat') ;
    in directory .......\frm I added file test.bat :
    REM ===============
    cd /d C:\........\ldr
    pause
    sqlldr parfile=test.par
    pause
    type test.log
    pause
    exit
    REM ================
    now, pressing TEST button opens DOS window, telling me what's going on, running sqlldr, finally going back to forms
    Are you using NO_PROMPT or NO_SCREEN option of HOST command ?
    Had a look at Forms 4.5 manuals, there is no mentioning of (a)synchronously operation in connection with HOST command.

  • Why do I get error -17500 when calling a batch file using the call executable step type?

    I am calling a batch file using the call executable step type. If the path to the batch file contains a space I get error -17500 and a message stating there was an error in "Post". For example the path to the batch file is "c:\TestWin\Test Files\...\Program.bat" When I run this I get the above mentioned error, however if I change my directory structure so the path is now "c:\TestWin\TestFiles\...\Program.bat" it runs fine. I use the browse feature to find my batch file so it is not me typing in a path incorrectly. I have removed the batch file and I get a different error stating that it couldn't find the file so it appears that for my error it can find the file but can't run it. I am
    sure that this has something to do with the fact that batch files are written in DOS but really don't want to resort to changing my directory structure on all my test stations. Is there any way to fix this problem so I can leave a space in my path?

    It appears I have figured it out. This was on another computer so I was unaware of how they used their computer. I like you got it to work in the temp directory and in fact got the program.bat file to work as long as I put it under the temp directory, but when I switched out to my TestWin directory it wouldn't work, so I removed everything from the directory except the batch file it self and it work. What I found out after adding files in one at a time is that the person had a file called "Test" with no file extension in there "c:\TestWin\" directory. Removing this file made it work. Putting the file back broke it. So it appeares that when teststand was running it followed the path saw a space and attempted to grab the "Test" file instead of bro
    wsing into the "Test Files" directory. If you create a file in your temp directory called "temp" with no file extension you will see the same problem. Thank you for your help.

  • How to use host command for creating folders

    i want to create a folder called abc in my C drive using forms 6i.
    how can i do it using Host command?

    Host('MD C:\ABC');Francois

  • Running an SQR using HOST command

    We are using Forms 10g and want to call sqr using the host command. The only way we can get this to work is to put the sqr call in a shell script which also contains all of the necessary environment variables and then use host to run that shell script.
    I've tried putting the environment variables in default.env to no avail.
    (This is a UNIX environment).
    Is it possible to run an sqr directly using the host command?
    host('sqr .....')
    Thanks in advance!

    nope. You can use host command. And modify the shell script in such
    a way that the results are written to a text file and read the result using
    text io
    Best regards
    Rajesh ALex

  • Run shell script using Host Command

    How do I run Unix Shell Script using Host command?
    Please help me......

    Are you running the shell script from the same box as the forms are deployed in? If not, then HOST call will try to execute on the machine where the forms are hosted(App server).

  • Use Host command in Oracle forms 6i

    hi
    all
    i use Oracle forms 6i i run in a web and in that i have connect one server so,
    i have to use Host Command and i have to fire this command
    host (' net use \\windchillsvr\e\jyotionline /user:dwg_users dwg_users');
    But it's Not Connect
    My Forms in run in Web
    so help

    JavaBean does d othe job for you but it requires signing process; I used it when I was working on forms6i for our project.
    I could use another approach that is the file type command executable which it stays in client's PC to do it and it does not requires signing at all since I am now working on the Java EE project for downloading and launching the third party tool in client's PC.
    I plan to write a article for forms use, which could do all the heavy WebUtil can do, but not need to go thru the signing process.

  • Using host command

    hi all i am shayan and again prob:-(
    i am using oracle 9iDs and forms are run on the web......i had used host command...but it is only open the program on the server....for example i haved open calculator with host command but it is only open on server not on the local computer

    Forms was originally designed as a client/server product. This means that functions like HOST, TEXT_IO, OLE, etc were expected to perform a task on the client machine. Well, this really hasn't changed with the deployment moving to the web. However, the difference is that the client to the database is now the middle tier and these tasks are executed there.
    To perform actions on the end-user (client) machine you will need to use a signed Java Bean. As mentioned by harmvos, Oracle offers WebUtil as an add-on to Forms if you don't want to write your own Java Bean. It can be used with Forms 9.0.4 and newer. It can be used with 902, but since 902 is no longer supported, this isn't recommended.
    http://www.oracle.com/technology/products/forms/htdocs/webutil/webutil.htm

  • Using Voice command to call some one...

    Hello,
    On the key note presentation in June the Steve Jobbs had done he used voice command to call a person.
    How do you go about doing the set up for that. I can not seem to do it.
    Sean

    I could swear he did because he made a comment along the lines that "today's technology" ...
    I could be wrong but I can not quote his comment but I know he made a comment about it before he did it.....
    Oh well. One would think with the issue of driving and cell phone this would of been included.
    Sean

  • I am having problems using my iphone4 during calls. When any part of my facial skin touches the screen, it would either go mute, hold, speaker or whatever part my skin accidentally touches the screen.The other caller then cant hear me

    I am having problems using my iphone4 during calls. The screen does not automatically lock to prevent any part of my skin or face from touching it. When my skin touches the screen it would either go mute, hold, divert to speaker phone or calls another in my contact list. The person i'm talking to then cannot hear me suddenly when in mute or hold. Is there any application for my iphone4 like a "screen lock" when it is being used on calls?

        Hello APVzW, we absolutely want the best path to resolution. My apologies for multiple attempts of replacing the device. We'd like to verify the order information and see if we can locate the tracking number. Please send a direct message with the order number so we can dive deeper. Here's steps to send a direct message: http://vz.to/1b8XnPy We look forward to hearing from you soon.
    WiltonA_VZW
    VZW Support
    Follow us on twitter @VZWSupport

  • HOST IN 10g to run batch file on application server

    Hi,
    I am trying to deploy a form from 6i to 9i. the form use Host builtin to run batch file on machine. this works fine when i run form on client server environment. but when i run the same form after compiling in 9i and run on 3 tier model and try to run batch file from form it give me error that
    'ftp' is not recognized as an internal or external command,
    operable program or batch file.
    any suggestion?

    It could be because the Host session doesn't have any environment variables set i.e. there is no PATH variable, so it simply doesn't know where to look to find the 'ftp' executable. You could try supplying the explicit path of the ftp executable and see if that works. (This was a problem I had running Host commands on a Unix application server.)
    James

  • Calling a batch file in sql scripts

    Hi friends,
    I am looking for a way to call any batch file in sql scripts.I am avoiding to use DBMS_SCHEDULER package because my application server and database server are diifferent .
    I am using the sql script in application server.plz help.

    <ironic>
    Ah, I see. This of course explains everything.
    </ironic>
    Now to be serious: there is no way to run a batch script from SQL. The tools which submit SQL Statements to the database are often capable of doing so; host in SQL*Plus can issue OS commands, the host builtin in Forms does it too, and with dbms_scheduler you can run a shell script on the database server.
    So depending on the tools you are using there are several ways to run OS commands. So far you didn't tell us what you want to do with what tools in which version you want to do it. So to only answer is: this is not possible. You cannot run a batch script from plain SQL.
    cheers

  • I need to call a batch file from java and pass arguments to that Batch file

    Hi,
    I need to call a batch file from java and pass arguments to that Batch file.
    For example say: The batch file(test.bat) contains this command: mkdir
    I need to pass the name of the directory to the batch file as an argument from My Java program.
    Runtime.getRuntime().exec("cmd /c start test.bat");
    How to pass argument to the .bat file from Java now ?
    regards,
    Krish
    Edited by: Krish4Java on Oct 17, 2007 2:47 PM

    Hi Turing,
    I am able to pass the argument directly but unable to pass as a String.
    For example:
    Runtime.getRuntime().exec("cmd /c start test.bat sample ");
    When I pass it as a value sample, I am able to receive this value sample in the batch file. Do you know how to pass a String ?
    String s1="sample";
    Runtime.getRuntime().exec("cmd /c start test.bat s1 ");
    s1 gets passed here instead of value sample to the batch file.
    Pls let me know if you have a solution.
    Thanks,
    Krish

Maybe you are looking for

  • Motion menus not working after Leopard

    I see that other people are having problems with motion menu templates after installing Leopard. I tried trashing my prefs and that didn't work. Has anyone else found a solution to the issue. Thanks!

  • Html form becomes red before inserting anything

    Whats the problem with my form on www.tacitus-reisen.de/s1buchen.html ? The php-script works fine, but the form should be like the one on www.tacitus-reisen.de/anfrage.html I used the muse form first, and added select-tags later, what caused these is

  • Ipad synchronisation?

    I have just re installed itunes on my HP laptop (Windows XP) because initially, my itunes could not access itunes store. Now, when I connect my ipad to my laptop, it gives me this message. ' This ipad cannot be used because the required software is n

  • Invoices posted through MIRO

    Hello All Does anyone know which table the documents posted through MIRO are held in?. I am particulery interested in the payment block flag. I have an invoice where it differs from the finance document I have already check tables BSIK and BSAK Thank

  • ISight black screen revisited

    After calling Applecare the other day, I still have no image when using iSight in photobooth, imovie and ichat. As with all of the other users reporting this problem, the green light is on but no image. I have already looked at the iSight troubleshoo