Coldfusion 10: execute as command line

Using CF10 on a unix system.  Attempting to use cfexecute on perl and batch files do not work but they run fine when executed directly from command line.  The perl and bat file permissions are set so anyone can execute them.  Does anyone know if I make coldfusion execute the perl or bat file as if it was running as a command line?  May need to designate specific user the execute them as.
<cfexecute name="#EDRSDIR#/uploadconvertwrapper.pl" arguments="#filedirectory# #finalfilename# #dcnflag# #splflag# outputFile="/dev/null" timeOut="0" />
<cfexecute name="#EDRSDIR#/uploadconvert.bat" argumensts="#filedirectory# #finalfilename# #dcnflag# #splflag# outputFile="/dev/null" timeout="0" />

What about:
correcting the spelling of 'arguments';
dropping the .pl and .bat extensions;
giving the timeout a value greater than 0;
adding an error variable which you can output for debugging.
<cfexecute name="#EDRSDIR#/uploadconvertwrapper" arguments="#filedirectory# #finalfilename# #dcnflag# #splflag# errorVariable="errorOutput" timeout="10" />
<cfexecute name="#EDRSDIR#/uploadconvert" argumensts="#filedirectory# #finalfilename# #dcnflag# #splflag# errorVariable="errorOutput" timeout="10" />

Similar Messages

  • How to execute unix command line from cocoa?

    how to execute unix command line from cocoa?
    for example, if I want to call "ping" from cocoa, how should I do it? and how can I obtain the return value?
    thank you.
    Power G5 Quad Mac OS X (10.4.3)

    The following article may also help:
    http://cocoadevcentral.com/articles/000025.php
    Mihalis.
    Dual G5 @ 2GHz   Mac OS X (10.4.6)  

  • How to run an executable from command-line

    I'm learning how to use the Terminal and I got stuck in a silly thing (I suppose it is). How can I run an executable file from command-line in Terminal?
    For example: I have a file named "Hello" in the folder /sample. If I use the ls command (ls sample), I can see the file Hello. Then I move to the directory (cd /sample) and try to run the file Hello (typing "Hello") but I got "command not found" message.
    If I drag the Hello file from Finder to Terminal and hit Return, it runs perfectly. And if I type the full path to the file (even if I'm already inside its directory), it also runs.
    So, my doubt is if there is any command to run an executable from command-line.
    Thanks

    KJK555 wrote:
    Hi VK:
    Can you enlighten me on why it's neccessary to do the "./" thingy in OS X when in unix/linux
    I never had to resort to doing that?
    Kj
    I took the trouble of reading *man bash* and it explains the issue. to add the current directory to PATH you need to add an empty path to PATH like this
    PATH=$PATH::
    you can add it to ~/.bash_profile so that it's executed automatically when you start bash. I suspect the linux system you are talking about had this set up by default or had it added to PATH in /etc/profile which defines PATH globally.

  • How to include a parameter executing a command line from java??

    Hey
    I've a problem It's very single for you: this consists in execute a command from java
    in this case the command is : runas but I've tried nd is good but I can´t include the password.
    This is due to the sintaxis is :
    runas /user:127.0.0.1\Administrator cmd
    The first command is execute but.. the problem is it show the input for the password.
    And the password is not let including in the command line
    How can I do that? Please help me is very urgent.
    Any help will be very appreciated.
    Thanks in advance.
    Best Regards.

    DAnt. wrote:
    what is the name of the correct forum which I must visite? this is because I couln't found the correct forum.You will not find it on the Oracle website
    I expect your prompt reply,help me!http://tinyurl.com/yak89nc

  • Executing multiple command lines in command prompt (windows)

    Hi,
    I am currrently using the command prompt in the windows to try to send a command to the microcontroller that is connected through TCP connection.
    I am able to use the normal cmd.exe to send the command but am unable to send all the command successfully using labview. 
    The Vi. that I am using the the system exec.vi found in labview connectivity section. 
    Basically what I want to send is "telnet A1" in the cmd.exe to establish connection to the microcontroller, followed by "FOR A1 100 GO" which will be intepreted by the microcontroller to make the necessary motion. But currently, the problem is that I can only establish connection using the system exec.vi but am unable to send the second part of the message "FOR A1 100 GO". 
    My command line i tried typing is cme.exe /K telnet A1 & FOR A1 100 GO. it seems that labview is only able to execute the first command part. Is there any other alternatives? 
    Thanks everyone for your help. 
    Solved!
    Go to Solution.

    Hi,
    Thanks for the help, the picture shows 1 of the error which state Error 56, the error occurs occasionally whenever I have used the command prompt to send a message to the microcontroller.
    Alternatively, there are times when no errors occur but my microcontroller does not move as well. It does move if I were to send the command through the cmd prompt.
    And I have attached a picture of my program as well. I am currently using Labview 2010 32bit. Thanks.
    Jh
    Attachments:
    TCP Connection.jpg ‏170 KB
    Error56.png ‏222 KB
    Picomotor_App New v3.0.vi ‏38 KB

  • Unable to execute HFMAudit Command line utility

    Hi All,
    We are going to use HEMAudit extract utility for extracting data &task audit tables.Hope All of you aware of that we can use this utility in two ways.One is through Wizard another one is thorugh commandline...We tried to execute the utility through Wizard,it was executing successfully and extract the both data&task audit tables.But when We tried to execute thro commandline got the following error..
    C:\Hyperion\products\FinancialManagement\Consultant Utilities>HFMAuditExtractCmdLine.exe  -d C:\Test
    -u C:\Hyperion\products\FinancialManagement\hfm.udl -a TEST -l ; -s 2011/07/15 -e 2011/07/22 -t Enabled
    -D Enabled -k Disabled -r Disabled
    Processing objects initialized.
    Completed parsing command line parameters.
    Extract starting using these parameters:
    UDL:  C:\Hyperion\products\FinancialManagement\hfm.udl
    Application:      TEST
    Destination folder:  Enabled
    Log File Name:
    Field Delimiter:     (;)
    Start Datetime:      07/15/11 00:00:00
    End Datetime:        07/22/11 00:00:00
    Extract Task Audit:  True
    Truncate Task Audit: True
    Extract Data Audit:  True
    Truncate Data Audit: True
    T E S T Connecting to data source...
    Getting schema version...
    Starting processing...
    Caching Metadata...
    Processing extracts...
    Extracting Task Audit...
    Determining number of records...
    Selecting records for extract...
    Processing results...
    Export failed. (-2147467259)
    Processing failed.
    It shows " Export Failed" .Anyone could you help me for this
    Thanks in Advance

    Duplicate post:
    http://forum.java.sun.com/thread.jspa?threadID=5203526&messageID=9812067#9812067

  • PJC executed in command line

    Hi,
    I've built a PJC wich dearchives jar files and writes the contents to local harddrive...
    I've even created a main function ,to test the utility from JDeveloper,before deploy to a signed jar in forms server...
    The utility works ok,on web environment with JINitiator 1.3.1.9,and the same when executed in JDeveloper...
    The total surprise raised when I copied the command line generated by JDeveloper for execution,and running it in a command prompt...
    C:\>D:\jdeveloper\jdk\bin\java -jar -classpath D:\jdevtests\Workspace3\F_dwld\f
    dwld.jar;D:\jdeveloper\jdev\lib\jdev-rt.jar;D:\jdeveloper\forms90\java\f90all.ja
    r fdwld.jar C:\temp\jar\fdwld.jar
    Exception in thread main
    java.lang.IllegalStateException: zip file closed
    java.util.zip.ZipEntry java.util.zip.ZipFile.getEntry(java.lang.String)
    java.util.zip.ZipEntry java.util.jar.JarFile.getEntry(java.lang.String)
    java.util.jar.JarEntry java.util.jar.JarFile.getJarEntry(java.lang.Strin
    g)
    java.util.jar.Manifest java.util.jar.JarFile.getManifest()
    or when trying to execute the class from the same command prompt...
    C:\>D:\jdeveloper\jdk\bin\java.exe -hotspot -classpath D:\jdevtests\Workspace3\F
    _dwld\classes;D:\jdeveloper\jdev\lib\jdev-rt.jar;D:\jdeveloper\forms90\java\f90a
    ll.jar oracle.forms.demos.un_jar C:\temp\jar\fdwld.jar
    Exception in thread "main" java.lang.NoClassDefFoundError: oracle/forms/demos/un
    _jar
    Note that the classes folder contains a oracle.forms.demos subfolder
    I've even tried the command line with another local JDK 1.3.1 and it is the same exception
    I'm totaly confused...what am I missing,that JDeveloper does with the PJCs and the command line isn't??

    I've investigated further the problem,and , look what i've found: when trying to execute a jar file deployed by JDeveloper from the class file,a exception occured...I've altered the manifest.mf file,and something else happens now: JDK13,or jdk14 can't see the oracle.forms.demos.VBean class located in f60all.jar file
    I have a forms6i release 2 installed,and the command line points to the f60all.jar in the forms60\java folder...
    Here is the command line,and, the output:
    C:\temp>d:\jdk14\bin\java -jar -classpath d:\jdk14\jre\lib\rt.jar;D:\forms6i\FORMS60\java\f60all.jar fdwld.jar fdwld.jar
    the class takes a filename as arg
    the output is
    Exception in thread "main" java.lang.NoClassDefFoundError: oracle/forms/ui/VBean
    at java.lang.ClassLoader.defineClass0(Native Method)
    at java.lang.ClassLoader.defineClass(ClassLoader.java:509)
    at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:12
    3)
    at java.net.URLClassLoader.defineClass(URLClassLoader.java:246)
    at java.net.URLClassLoader.access$100(URLClassLoader.java:54)
    at java.net.URLClassLoader$1.run(URLClassLoader.java:193)
    at java.security.AccessController.doPrivileged(Native Method)
    at java.net.URLClassLoader.findClass(URLClassLoader.java:186)
    at java.lang.ClassLoader.loadClass(ClassLoader.java:306)
    at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:265)
    at java.lang.ClassLoader.loadClass(ClassLoader.java:262)
    at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:322)
    Any ideas why the VBean class isn't found by the JVM ??
    The file is there in the F60all.jar

  • Execute system command line instructions

    Hi,
    suppose that my java program has to execute a system command line instrction(let's say dir/p for dos or ls * f or linux)
    how can we execute these system command line instructions programmatically from within a java program?
    thanks indeed for helping...

    i want to thank jfbriere for the usefull link he/she provides me with. 1- He
    2- You're welcome :-)

  • Execute windows command line to a file

    Hi,
    I would like to run a windows command line from Java and output the result to a file.
    eg.
    cmd> mycommand hello > output.txt
    in windows ">" is to output the result to a file.
    I've tried
    String command  = "mycommand hello > output.txt";
    Process process = Runtime.getRuntime().exec(command);But that exec() didn't output to a file.
    Can someone give me an example on how to do this?
    Thanks

    You are falling for one of the traps described here. The redirection operator '>' has to be interpreted by a shell or command processor. On windows this would be
    String command  = "cmd.exe /C mycommand hello > output.txt";and on Linux this would beString command  = "sh -c mycommand hello > output.txt";You should read all 4 sections of the traps article and implement ALL the recommendations or you will be back here again.

  • Launch executable with command line arguments

    I have a programmer that I need to launch in my cvi code.  I tried the system command and lauchexecutable command but cannot get the programmer to lauch correctly.  If I run it from the command prompt or create a windows shortcut it works fine.  Here is the shortcut I created:
    C:\TPD\SAVS20P3\asix\up\up.exe /e c:\tpd\savs20p3\q33.hex/erase /q /p
    I'm trying to run the up.exe software with /e c:\tpd\v20_hex\v20.hex /erase /q /p as the command line paramters.
    I tried the following code which created the above path with command line
     strcpy(filename,"C:\\tpd\\savs20p3\\asix\\up\\up.exe /e c:\\tpd\\savs20p3\\hex_ee\\");   ///e c:\\tpd\\savs20p3\\hex_ee\\"");
      strcat(filename, hfile);//hex file name will change dynamically
      strcat(filename, "/q /p");
    I then tried LaunchExecutable(filename) and system(filename).  The system functions gives an error.  Its trying to lauch the /e c:\tpd\v20_hex\v20.hex file
    any suggestions.  I beieve its a simple syntax error.

    Well, apart evident typos in the code you posted, which is not creating the command line you stated, I can only think that before "/q" you should add a space to separate the option from the filename.
    This code should create the correct command line:
    strcpy (hfile, "c:\\tpd\\v20_hex\\v20.hex");
    strcpy (filename, "C:\\tpd\\savs20p3\\asix\\up\\up.exe /e ");
    strcat (filename, hfile);
    strcat (filename, " /erase /q /p");
    Proud to use LW/CVI from 3.1 on.
    My contributions to the Developer Zone Community
    If I have helped you, why not giving me a kudos?

  • Execute Process Task :Executing DOS Command lines in Execute Process Task

    Hi All,
    I am trying to sftp files using Tectia Client from my local system. For that I have used the Execute Process Task in SSIS. First I open DOS command and try to instantiate the sftp3.exe.
    Then I write down the below command
    binary
    open username@hostname
    lcd C:\Test
    cd <Destination Path name>
    put test.txt
    How to execute the command in execute process task ?
    help is appreciated
    Thanks

    Hi ConnectDebz,
    According to your description and script example, do you use WinSCP.exe to perform the SFTP files transfer? If so, you should set the Executable of the Execute Process Task to the path of the WinSCP.exe, save the script in a .txt file and set the Argument
    of the Execute Process Task like “/script=C:\Temp\sftploader.txt” (without quotes).
    References:
    http://www.sqlservergeeks.com/blogs/raunak.jhawar/sql-server-bi/395/sql-server-sftp-with-ssis-execute-process-task 
    http://gregcaporale.wordpress.com/2012/02/23/using-sftp-in-sql-server-ssis/ 
    Regards,
    Mike Yin
    If you have any feedback on our support, please click
    here
    Mike Yin
    TechNet Community Support

  • Unable to execute a command line command using Java

    I am trying to run a command to add a group name. It is executed in command prompt of Windows 2003/2000
    Say this is the command I want to execute:
    net localgroup LordSM /add
    Here LordSM is the group name.
    I wrote the following code but it does not seem to work. Please suggest.
    String ABC=Value1TextField.getText();
    Value2Label.setText("Value is now " + ABC);
    // Above is to get value from a JText Field
    // Below is the code to run command for adding a group name to a System.
    String ExecutedCmd = "net localgroup " + ABC + "/add";
    Process p = Runtime.getRuntime().exec(ExecutedCmd);
    BufferedReader stdInput = new BufferedReader(new InputStreamReader(p.getInputStream()));
    BufferedReader stdError = new BufferedReader(new InputStreamReader(p.getErrorStream()));
    // read the output from the command
    System.out.println("Here is the standard output of the command:\n");
    while ((s = stdInput.readLine()) != null)
    { System.out.println(s); }
    // read any errors from the attempted command
    System.out.println("Here is the standard error of the command (if any):\n");
    while ((s = stdError.readLine()) != null)
    { System.out.println(s); }
    I am trying to run a command to add a group name. It is executed in command prompt of Windows 2003/2000
    Say this is the command I want to execute:
    net localgroup LordSM /add
    Here LordSM is the group name.
    I wrote the following code but it does not seem to work. Please suggest.
    String ABC=Value1TextField.getText();
    Value2Label.setText("Value is now " + ABC);
    // Above is to get value from a JText Field
    // Below is the code to run command for adding a group name to a System.
    String ExecutedCmd = "net localgroup " + ABC + "/add";
    Process p = Runtime.getRuntime().exec(ExecutedCmd);
    BufferedReader stdInput = new BufferedReader(new InputStreamReader(p.getInputStream()));
    BufferedReader stdError = new BufferedReader(new InputStreamReader(p.getErrorStream()));
    // read the output from the command
    System.out.println("Here is the standard output of the command:\n");
    while ((s = stdInput.readLine()) != null)
    { System.out.println(s); }
    // read any errors from the attempted command
    System.out.println("Here is the standard error of the command (if any):\n");
    while ((s = stdError.readLine()) != null)
    { System.out.println(s); }
    It does not seem to work means, that no Standard Error is defined, when it executes and group name is not added as well. The following is JUnit Test Result: Hope it gives a better idea of the problem I am facing:
    compile:
    run:
    Here is the standard output of the command:
    Here is the standard error of the command (if any):
    The syntax of this command is:
    NET LOCALGROUP [groupname [/COMMENT:"text"]] [DOMAIN]
    groupname {ADD [/COMMENT:"text"] | /DELETE} [DOMAIN]
    groupname name [...] {ADD | /DELETE} [DOMAIN]
    Got it
    BUILD SUCCESSFUL (total time: 10 minutes 49 seconds)
    I had even tried this:
    Runtime rt =Runtime.getRuntime();
    String[] cmd = new String[3];
    cmd[0] = "cmd.exe";
    cmd[1]="net localgroup";
    cmd[2] =ABC + "/add";
    rt.exec(cmd);
    but again, it does not give any error as such, but it does not create the group name either. Please suggest. We can see the group names that are added on right clicking My Computer Icon and click Manage and then go to User & Group section. On executing either of the code nothing happens.
    Thanks

    Duplicate post:
    http://forum.java.sun.com/thread.jspa?threadID=5203526&messageID=9812067#9812067

  • Need code sample to execute a command line in form builder

    i need to write code in the fmb file
    to be executed when running a form

    Hi
    use this command in your fmb,
    Host(<CommandLineCommand>,No_Screen);
    hope this works for you.
    regards
    gaurav

  • Problem executing command line program

    Hi I have a tuxedo command line app in Solaris 2.6. I was able to execute the program from unix prompt however when I try to do it from JAVA program, it does not work.
    I have to execute from command line as follows
    $ud32<SPACE>-U<SPACE>login<nl>
    SRVCNM<TAB>CB_EXESUB<nl>
    CLFY_SUB<TAB>ExeternalMsg<nl>
    EQUIP_ID<TAB>1<nl>
    <nl>
    during command line execution from second line on you will not get the prompt. After entering a balnk line the program will execute and provide the output.
    I was aslo able to execute the program by putting the last 4 lines in a file(say test.bat) and executing by issuing following command at the unix prompt
    $ud32 -U sa<test.bat
    My java program as follows.
    import java.io.*;
    public class udexec {
    public static void main(String args[]) {
    try{
    Runtime rt = Runtime.getRuntime();
    System.out.println("Before");
    Process prcs = rt.exec("ud32 -U sa");
    System.out.println("After: " + prcs);
    InputStreamReader isr = new InputStreamReader(prcs.getInputStream());
    PrintWriter out = new PrintWriter(prcs.getOutputStream());
    out.println("SRVCNM CB_EXESUB");
    out.println("CLFY_SUB ExternalMsg");
    out.println("EQUIPID 1");
    out.println("");
    int ret = isr.read();
    String line;
    System.out.println("Before Print");
    System.out.println(ret);
    catch (Exception e) { System.out.println(e); }
    Any help will be greatly appreciated.
    Thank You
    Raju

    Hmm, maybe you should also give additional Excape Characters to the Process (so adding \t where you have written <TAB>, or adding \r to the lines).

  • To execute command line from java programmin

    Hi,
    I need to execute a command line like ping command from java applications can any help me on this. Thanks in advance.

    Runtime.exec
    Also read: When Runtime.exec() won't: Navigate yourself around pitfalls related to the Runtime.exec() method

Maybe you are looking for

  • Scheduling parameters are not defined for production orders

    Hi All,          when i convert the planned order to production order  i got this massage popup coming  Scheduling parameters are not defined for production orders . please let me know this .

  • Can't reset my iPhone 3gs with home button

    reset iphone

  • Where can I buy more synths?

    Are there synth packs for Garageband besides the Jam Packs? I've been looking on the web and there's just too much information to sort through. I don't want to have to download different programs and export and blah blah blah. Thanks!

  • HOST Solution

    Host Command usages in Forms6i (OS Win-2000): HOST('RunBrowser http://www.hotmail.com', NO_SCREEN); PS: You may need to copy RunBrowser.exe from "Oracle Forms and Reports Demos" CD to ORALCE_HOME/Bin directory. Hope this will work for you! Jagannath

  • Oracle sql developer version

    Hi, My first question is where do i find the version of oracle sql developer? My second question is when i check one of the OSUSER name column is null.how it occurs? and how do i give corresponding name to its column? Kindly help . thanx in advance