Run command line from receiver

Hello,
I write script to transfer file from our local drive to sFTP server.
I try to run  the script from Run Operating System Command After Message Processing in CC
The script not run.
When I try to run this script from our XI server from CMD the script running.
I add the script command line:
"C:\Program Files\WinSCP\WinSCP.exe" /console /script="C:\Program Files\WinSCP\fromnetafim.txt"&"C:\Program Files\WinSCP\script.bat"
I'll be happy to hear what I need to add to this line to run the script from communication channel.
Elad

Hi,
You just post ur output file in some folder , lets say /usr/sap/sapout/test/.and the shell script in this path /usr/sap/bin/convert.sh.
Inside the File access parameters put target directory and filename scehme and for shell script give processing parameters as File construction mode , File type and OS Command and use a space after the shell script name and the %F.
And for input can use it directly.
Check out these links. First one will help you in acheiving want you want.
/people/sameer.shadab/blog/2005/09/21/executing-unix-shell-script-using-operating-system-command-in-xi
/people/michal.krawczyk2/blog/2007/02/08/xipi-command-line-sample-functions
/people/michal.krawczyk2/blog/2005/08/17/xi-operation-system-command--error-catching
http://help.sap.com/saphelp_nw70/helpdata/en/e3/94007075cae04f930cc4c034e411e1/content.htm
Also have a look on this thread.
Re: RUN OPERATING SYSTEM COMMAND BEFORE MESSAGE PROCESING?
regards
Aashish Sinha
PS : reward points if helpful

Similar Messages

  • Using java to run command line as %username%

    Hi all,
    can any one help with this?
    I'm trying to run a command line from a database as %username% in Windows. So far I have the following script, courtesy of Frank Naude to build a java class that is published within a plsql procedure. A command line can then be passed to it.
    rem -----------------------------------------------------------------------
    rem Filename: oscmd.sql
    rem Purpose: Execute operating system commands from PL/SQL
    rem Notes: Specify full paths to commands, for example,
    rem specify /usr/bin/ps instead of ps.
    rem Date: 09-Apr-2005
    rem Author: Frank Naude, Oracle FAQ
    rem -----------------------------------------------------------------------
    rem -----------------------------------------------------------------------
    rem Grant Java Access to user USER1
    rem -----------------------------------------------------------------------
    conn sys/password@database as sysdba
    EXEC dbms_java.grant_permission('USER1', 'SYS:java.lang.RuntimePermission', 'writeFileDescriptor', '');
    EXEC dbms_java.grant_permission('USER1', 'SYS:java.lang.RuntimePermission', 'readFileDescriptor', '');
    EXEC dbms_java.grant_permission('USER1', 'SYS:java.io.FilePermission', '/bin/sh', 'execute');
    EXEC dbms_java.grant_permission( 'USER1', 'SYS:java.io.FilePermission','C:\WINDOWS\system32\cmd.exe', 'execute' );
    rem -----------------------------------------------------------------------
    rem Create Java class to execute OS commands...
    rem -----------------------------------------------------------------------
    conn user1/password@database
    CREATE OR REPLACE AND COMPILE JAVA SOURCE NAMED "Host" AS
    import java.io.*;
    public class Host {
    public static void executeCommand(String command) {
    try {
    String[] finalCommand;
    finalCommand = new String[4];
    finalCommand[0] = "C:\\WINDOWS\\system32\\cmd.exe";
    finalCommand[1] = "/y";
    finalCommand[2] = "/c";
    finalCommand[3] = command;
    // Execute the command...
    final Process pr = Runtime.getRuntime().exec(finalCommand);
    // Capture output from STDOUT...
    BufferedReader br_in = null;
    try {
    br_in = new BufferedReader(new InputStreamReader(pr.getInputStream()));
    String buff = null;
    while ((buff = br_in.readLine()) != null) {
    System.out.println("stdout: " + buff);
    try {Thread.sleep(100); } catch(Exception e) {}
    br_in.close();
    } catch (IOException ioe) {
    System.out.println("Error printing process output.");
    ioe.printStackTrace();
    } finally {
    try {
    br_in.close();
    } catch (Exception ex) {}
    // Capture output from STDERR...
    BufferedReader br_err = null;
    try {
    br_err = new BufferedReader(new InputStreamReader(pr.getErrorStream()));
    String buff = null;
    while ((buff = br_err.readLine()) != null) {
    System.out.println("stderr: " + buff);
    try {Thread.sleep(100); } catch(Exception e) {}
    br_err.close();
    } catch (IOException ioe) {
    System.out.println("Error printing execution errors.");
    ioe.printStackTrace();
    } finally {
    try {
    br_err.close();
    } catch (Exception ex) {}
    catch (Exception ex) {
    System.out.println(ex.getLocalizedMessage());
    show errors
    rem -----------------------------------------------------------------------
    rem Publish the Java call to PL/SQL...
    rem -----------------------------------------------------------------------
    CREATE OR REPLACE PROCEDURE host(p_command IN VARCHAR2)
    AS LANGUAGE JAVA
    NAME 'Host.executeCommand (java.lang.String)';
    show errors
    rem -----------------------------------------------------------------------
    rem Let's test it
    rem -----------------------------------------------------------------------
    exec host('notepad');
    The trouble is although this script works great for commands that can be run is the 'background' as SYSTEM is I want to pass a command to actually open something e.g. notepad in the above example nothing seems to happen. As far as I can make out the command line is running but not as %username% so it's not running notepad.exe in the foreground.
    I'm happy to clarify more if necessary.
    Can anyone help with this?
    Cheers
    Yog

    Bill,
    Thank you for the quick answer. I believe you are right in your assumption.
    I have been searching but found nothing so far.
    I need to be able to run this line "wmic
    Product where name='XXX XXX XXX' call uninstall" 
    in an elevated command prompt to uninstall the program.
    I was looking for a VB script or PowerShell to execute it remotely on non domain roaming PCs.
    Th3e command can be run remotely against stand-alone workstations but you must supply credentials.  Post in the platform forum for you version of Windows for help in using the WMIC utility.  WMIC /? will give you all of the command options fro
    remote execution.  UAC only affects local systems.  You cannot use WMIC to remote back to the local system. WMIC does not allow impersonation to the local system.
    Most installers will not automatically allow an unattended uninstall.  If there is any dialog at all the uninstall will fail and can hang.
    I recommend contacting the vendor of the application to get more information.
    In all cases you cannot bypass UAC as Bill has noted.  I am only noting that, sometimes, in a workgroup, you can use WMIC to remotely uninstall an application.
    ¯\_(ツ)_/¯

  • BO Edge 4.0 Installer stuck on "Run command-line executable"

    Hi,
    Our BO Edge BI Server 4.0 Installer on Windows Server 2008R2 is stuck on one of the last steps; "Run command-line executable".
    Before is was stuck on "WaitForCMSForTheFirstTime". We upped the RAM to 16GB and then the installer went past this, but after a full reset of the server and trying again it is now stuck a few steps later on "Run command-line executable". This is very frustrating, especially since there is no error message at all, no install log and the installer is just stuck indefinitely and we had to cancel it.
    At that point the Central Configuration Manager shows this:
    Apache Tomcat - Running
    BW Publisher Service - Stopped
    SAP BO Mobile Authentication Server - Stopped
    SAP BO Mobile Processing Server - Stopped
    Server Intelligence Agent - Running
    We can't deinstall from Windows to start over at this point because the installer says an install is in progress.
    What is going on?
    Help urgently needed and appreciated
    Edited by: J. Knulst on Jan 11, 2012 7:48 AM
    Edited by: J. Knulst on Jan 11, 2012 7:50 AM

    Hello,
    Yes, certain stages run for a long duration. "Run command-line executbale" runs for atleast 45 mins. It's normal.
    My suggestion would be to leave it for 45 mins-90 mins.
    Now that you have interrupted your installtion, try uninstalling it through the control panel.
    In case you can't see the software there, then you have to edit registry entries, which is very tiresome.
    Regards,
    Sonia

  • Unable to get command line from client!

    Does anyone know what this means? My G5 shuts itself down and I don't know what is causing it.
    Mac OS X Version 10.4.11 (Build 8S165)
    2009-02-12 11:01:19 -0800
    2009-02-12 11:01:21.760 SystemUIServer[199] lang is:en
    Feb 12 11:01:33 mDNSResponder: NAT Port Mapping (LLQ event port.): timeout
    Feb 12 11:01:37 cups-lpd[221]: Unable to get command line from client!
    Feb 12 11:10:48 Zelle-Olson cups-lpd[233]: Unable to get command line from client!
    Feb 12 11:17:37 cups-lpd[235]: Unable to get command line from client!

    Hello golferky,
    CUPS stands for Common Unix Printing System and is just one of the many background processes that is running on your system and is of no harm. What you are seeing in your message console is your Mac attempting to talk to a printer you have may have had or still have it connected to.
    Here is more information if you want to look into it.
    http://www.cups.org/
    B-rock

  • I can't find a class to run command line stuff...

    Does J2SE have the capability to run command line files/executable files? I need to run some things from command line on my local machine. This ap will be swing based. Thanks for any insight.
    nick

    that is what I need. I did not think to look there. Thanks so much.
    Nick

  • 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)  

  • Using computer variables in task sequence "Run Command Line"

    I am attempting to deploy VMs through VMware's vRealize Automation tool using CM. The process creates a CM computer object then creates a direct rule on a CM collection for the new computer object. During the creation of the computer object vRA creates computer
    variables provided by me on the computer object. I see the computer object built and i see the custom variables on the computer object:
    Name Value
    dns1 10.10.10.10
    dns2 10.10.10.11
    gateway 10.10.10.1
    ipAddress 10.10.10.2
    netMask 255.255.255.0
    In the task sequence the last step is to "Run Command Line":
    cmd /c netsh int ip set address name="Ethernet0" static %ipAddress% %netMask% %gateway% & cmd /c netsh int ip set dns name="Ethernet0" static %dns1% & cmd /c netsh int ip set dns name="Ethernet0" static %dns2% index=2
    When the TS gets to that step it doesn't substitute the variables in the command with the computer variables listed above. Looking at the smsts logs after the deployment is complete I see lines stating:
    Set Command Line:...
    Start executing command line:...
    Executing command line:...
    ProgramName = ...
    All of those lines show the command exactly as it is above with the %variables% intact.
    The command immediately fails with the error:
    Invalid address parameter (%ipAddress%). It should be a valid IPv4 address.
    Does anyone have a suggestion on why the TS isn't using the variables? I found this article https://technet.microsoft.com/en-us/library/bb693541.aspx but its for 2007 not 2012. I wasn't able to find something comparable for 2012.

    I don't know why anyone here thinks you *need* sccm osd to achieve fully automated customizations.
    Customer selects base image (2008 r2 core, 2008r2 gui, 2012 r2 core, 2012 r2 gui), which should be thin and with zero customizations anyway,
    vaai accelerated clone creates vm,
    ip addr/gateway/dns config is injected with powercli,
    customers config management engine agent of choice is installed via powercli script injection/execution (we have puppet users, ConfigMgr users, saltstack users, IEM users, Cheff users),
    the clone completes in ~2 minutes and a VM is presented to the customer in less than 5 minutes 
    Deploying windows VMs via SCCM OSD is not only slow, but requires dev work on the customer side to get things rolling which wastes everyone's cycles including your own

  • Command line from ExtendScript

    I would like to call a command line from a FrameMaker ExtendScript script. Is this possible? Any help or pointers will be appreciated. Thanks.
    Rick Quatro

    Hi Rick,
    AFAIK there's no direct way to call a process with parameters by ExtendScript.
    If want to call a process without parameters, you can execute this file with method "execute" with is provided by "File" class .
    If I have to call this process with parameters, I write write a batch file by script and execute this file.
    Bye
    Markus

  • Execute command line from Java

    I have an easy one for you!
    I would like to know how I can execute a command line from my java code.
    The only thing I want to do is to launch a html page with the default browser in my computer when I press one button of my java application but I dont know wich class I should use to do it. My application will already know what is the file name.
    Thank for your help
    Eric

    Javaworld has some source code that does this:
    http://www.javaworld.com/javaworld/javatips/jw-javatip66.html

  • Execute command lines from Xcelsius 2008

    Hello,
    Is there any possible way to execute command lines from Xcelsius 2008 swf?
    Thank you.

    Hi,
    You cannot call out to command-line from a Flash SWF, it is sandboxed so does not know how to do any of that.
    One (complicated) option would be to write your own app to embed the SWF into, a real app can then call out to do whatever you want, then you just have to get the SWF to communicate with your app using External Interface, it would be a lot of work.
    Regards
    Matt

  • TS-Run Command Line-run as different user

    HI
    I needed to deploy one program which do not like SYSTEM account (do not installs). So I created TaskSequence with
    Run Command line and specified domain user which will be running this command.
    Is my domain users password safe or it will be provided in clear text in my network? Because this user must be Admin on local computer.

    Just to reinforce, the tasks use standard, core Windows APIs to impersonate the account and execute the command -- these APIs never send anything in clear text and if they did, then Windows has much bigger issues. It would actually take
    a huge amount of effort to not securely perform this operation.
    Jason | http://blog.configmgrftw.com

  • Running a report or command line from a dtored procedure

    Is there a way I can call a report to run from a stored
    procedure or execute an os command line to do the same ting from
    a stored procedure?

    hello,
    if you are using the reports-server you can use UTL_HTTP to
    submit an HTTP-request to submit the job.
    regards,
    the oracle reports team --pw                                                                                                                                                                                                                                                                                                                       

  • Looking to run unix command line from Finder

    I want to run a unix command directly from finder. Kind of like using command-G to "Go To Folder".
    If a current method isn't supported, I noticed that Terminal.app has a shortcut for "New Command" using command-N. What would be the right way to create a keyboard shortcut in Finder that would call Terminal->New Command?
    Thanks

    You might use a third-party macro expansion utility that permits creating keyboard macro shortcuts. Examples include QuicKey or iKey. There are also several text expansion utilities that also allow attaching keyboard shortcuts such as TextExpander or Typinator. The above can be found at VersionTracker or MacUpdate.
    You can also create an AppleScript using the Do Shell Script command. The resulting compiled script can be attached to an Automator action. I don't know if you can attach a keyboard shortcut but you can add an Automator action to the Services menu and to the Finder's contextual menu.

  • Running a command line from JDeveloper

    I am new to JDeveloper. I want run the following file:
    java SplitFile < test.txt
    Is there a way to add the < test.txt to the run command or is there another way to run this?
    Thank you,
    Stephen Hartfield

    use Tools- External Tools - New.. to configure the program to run java command inside jdeveloper

  • Help Please: How to invoke unix command lines from java?

    I have read past topics. Those are really helpful, but I still haven't got my job done. I tried the following:
    String command1 = "ls -la > ls1.txt";
    Runtime.getRuntime().exec(command1);
    String command2 = "tcsh -c ls -la > ls2.txt";
    Runtime.getRuntime().exec(command2);
    String command4 = "cp keywords.txt copyversion1.txt";
    Runtime.getRuntime().exec(command4);
    String command5 = "tcsh -c cp keywords.txt copyversion2.txt";
    Runtime.getRuntime().exec(command5);
    String command6 = "tcsh -c 'cp keywords.txt copyversion3.txt'";
    Runtime.getRuntime().exec(command6);
    Only "command4" works. Any input will be greatly appreciated.

    Thank you very much Gautam. Your solution certainly works. If you don't mind, I would like to ask you (or anybody who is willing to answer) something else. I am trying to run other types of unix command lines as well. I thought that the format you gave would work for everything. But it doesn't seem so:
    String command1[] = {"tcsh", "-c", "ls -la > ls1.txt "}; // this works as you suggested
    Runtime.getRuntime().exec(command1);
    String command12[] = {"tcsh", "-c", "lynx -dump http://www.yahoo.com > webpage.txt"}; //working fine.
    Runtime.getRuntime().exec(command12);
    String command10[] = {"tcsh", "-c", "ngram-count -text keywords.txt -lm LM10 &"}; //doesn't work
    Runtime.getRuntime().exec(command10);
    String command[] = {"tcsh", "-c", "/u/drspeech/sun4/bin/ngram-count -text keywords.txt -lm LM0 &"}; // doesn't work
    Runtime.getRuntime().exec(command);
    String command13[] = {"tcsh", "-c", "ngc -text keywords.txt -lm LM13"}; // doesn't work
    Runtime.getRuntime().exec(command13);
    String command8 = "ngram-count -text keywords.txt -lm LM8 &"; //doesn't work
    Runtime.getRuntime().exec(command8);
    String command9 = "/u/drspeech/sun4/bin/ngram-count -text keywords.txt -lm LM9 &"; //doesn't work
    Runtime.getRuntime().exec(command9);
    I tried "commandd1" and "command12". Those worked fine. No problemo. However, there's someting else I need to get done for my job; that is "command10". But it just didn't work. I thought maybe, it's because "ngram-count" is not part of the standard UNIX commands. So, I thought I might just add another alias for it in the ".cshrc" file and call it "ngc" instead. Then I tried to call the alias "ngc" instead. But it didn't work also. Then I thought, maybe, I should call it by referencing it from its original directory "/u/drspeech/sun4/bin/ngram-count". That didn't work either. I tried a couple of other combinations. None worked. I would really like to see how to solve this.

Maybe you are looking for