Unable to run script (.bat file) on a windows server

Hi,
I have a job definition which execute cmd command (such as cd, echo, etc) through a platform agent installed on a Windows server but when I try to execute scripts (i.e. .bat file) it doesn't work.
Can someone help, please ?
Regards.

Hi,
The PA is running with the same account executing the .bat file on the server.
Yes, the bat file can be executed with that user outside of CPS.
Regards

Similar Messages

  • Running scripts, bat files, etc from a jar file

    Hello,
    Does anyone know of a way, or even if it is possible to run a script or batch file from a jar file?
    For instance, lets say I have a batch file that I can run from the command prompt by typing :
    myBatchFile.bat
    and now I write a very simple java app that will do the same:
    public class Test {
    public static void main(String[] args) {
    try {
    Runtime rt = Runtime.getRuntime();
    Process p = rt.exec(�myBatchFile.bat�);
    } catch (Exception e) {
    e.getMessage();
    The above app will work as long as the batch file is in the current directory, but how or can I make it work if I stick the batch file in a jar file along with the app?
    I tried using the manifest file with no luck.
    I tried creating a URI to the jar file, wrapping it in a File and then passing that File to the exec method also with no luck.
    I searched all the forums on Sun but came up with nothing.
    I performed a google search also with no luck.
    Does anyone have the answer to this? Even if I can get a definitive �No it can�t be done� answer. Although I would think that it should be able to be done.
    Thanks

    Hi,
    you cannot execute anything being inside a jar-file. The OS doesn't know anythig about jar-files and cannot look inside one to find the program/script/batch you want to execute.
    You could do a workaround by extracting the file from the jar-file before calling exec(). But normally OS dependent files should not be inside a jar-file and remain in a own directiory.
    Andre

  • Unable to run a Batch File Operating System Command

    Using XI 3.0, I am unable to run a Batch File Operating System Command After Message Processing.
    My Batch file:
    gpg -se -r BOA3RSKY --armor --passphrase-fd 0 %1 < C:\Progra~1\GNU\GnuPG\gpgin
    My Command Line (ID scenario)
    exec "cmd.exe /c C:\Progra~1\GNU\GnuPG\boagpg.bat %F"
    If I execute
    exec "cmd.exe /c type C:\Progra~1\GNU\GnuPG\boagpg.bat >xis.txt"
    It displays the contents of boagpg.bat file in xis.txt.
    I just don't understand why when I run the batch file, I would expect an %F.asc encrypted file in the same directory as the %F unencrypted file.
    Any ideas?
    or will I need Basis to create commands that will allow me to run GPG from XI Command Line?

    Check this links if its helpful
    http://help.sap.com/saphelp_nw04/helpdata/en/bb/c7423347dc488097ab705f7185c88f/frameset.htm
    /people/sap.user72/blog/2004/01/30/command-line-help-utility
    Check this thread a similar problem
    Process Integration (PI) & SOA Middleware
    Note 841704 - XI File & JDBC Adapter: Operating system command
    http://service.sap.com/sap/support/notes/841704
    Try to see the below links
    /people/michal.krawczyk2/blog/2005/08/17/xi-operation-system-command--error-catching
    OS Command on FTP
    OS command line script - Need help
    FTP - Run OS Command before file processing
    Note: reward points if solution found helpfull
    Regards
    Chandrakanth.k

  • Running a Bat file from a stored procedure

    This is part II of Re: Need to run bat file from application express
    I thought I would open a new thread
    I thought I had this fiqured out but it still doesn't work
    1) I granted CREATE EXTERNAL JOB to my user
    2) startup the OracleJobScheduler Service
    3)
    create or replace
    PROCEDURE RUN_OS_COMMAND(p_cmd IN varchar2)
    is
    v_job_exists pls_integer:=0;
    begin
      select count(1)
      into  v_job_exists
      from  all_scheduler_jobs
      where job_name='JAVA_EXE';
      if v_job_exists>0 then 
        dbms_scheduler.drop_job(job_name =>'JAVA_EXE');
      end if;
      dbms_scheduler.create_job
      (   job_name          =>'JAVA_EXE'
        , job_action        =>p_cmd
        , job_type          =>'executable'
        , enabled           =>false
        , auto_drop         =>false
        , start_date        =>systimestamp
      dbms_scheduler.run_job(job_name =>'JAVA_EXE');
    end;test.bat is del test.csv
    I run this
    begin
      RUN_OS_COMMAND('C:\temp\test.bat');
    end;
    / anonymous block completed
    It runs with no errors but does not run the bat file... what am i missing, thanks Doug

    LLUSERSPROFILE=C:\Documents and Settings\All Users
    APPDATA=C:\Documents and Settings\wblincoe\Application Data
    CLASSPATH=.;[ORACLE_HOME]\jdbc\lib\ojdbc6.jar;c:\myjar\xdocore.jar;c:\myjar\i18nAPI_v3.jar;c:\myjar\xdoparser.jar;c:\myjar\xmlparserv2.jar
    CommonProgramFiles=C:\Program Files\Common Files
    COMPUTERNAME=WBLINCOELT
    ComSpec=C:\WINDOWS\system32\cmd.exe
    DEFLOGDIR=C:\Documents and Settings\All Users\Application Data\McAfee\DesktopProtection
    FP_NO_HOST_CHECK=NO
    HOMEDRIVE=C:
    HOMEPATH=\Documents and Settings\wblincoe
    LDMS_LOCAL_DIR=C:\Program Files\LANDesk\LDClient\Data
    LOGONSERVER=\\03N-DAYT-DC01
    NUMBER_OF_PROCESSORS=2
    OS=Windows_NT
    Path=C:\OraHome_1\jre\1.4.2\bin\client;C:\OraHome_1\jre\1.4.2\bin;C:\app\wblincoe\product\11.1.0\db_1\bin
    PATHEXT=.COM;.EXE;.BAT;.CMD;.VBS;.VBE;.JS;.JSE;.WSF;.WSH
    PERL5LIB=C:\oracle\product\10.2.0\http_1\sysman\admin\scripts;C:\oracle\product\10.2.0\http_1\perl\site\5.6.1\lib;C:\oracle\product\10.2.0\http_1\perl\site\5.6.1;C:\oracle\product\10.2.0\http_1\perl\5.6.1\lib\MSWin32-x86;C:\oracle\product\10.2.0\http_1\perl\lib\5.6.1;C:\oracle\product\10.2.0\http_1\perl\lib\5.6.1\MSWin32-x86;
    PHPRC=C:\Program Files\PHP\
    PROCESSOR_ARCHITECTURE=x86
    PROCESSOR_IDENTIFIER=x86 Family 6 Model 15 Stepping 2, GenuineIntel
    PROCESSOR_LEVEL=6
    PROCESSOR_REVISION=0f02
    ProgramFiles=C:\Program Files
    PROMPT=$P$G
    SESSIONNAME=Console
    SystemDrive=C:
    SystemRoot=C:\WINDOWS
    TEMP=C:\DOCUME~1\wblincoe\LOCALS~1\Temp
    TMP=C:\DOCUME~1\wblincoe\LOCALS~1\Temp
    USERDNSDOMAIN=CACI.COM
    USERDOMAIN=CACI
    USERNAME=wblincoe
    USERPROFILE=C:\Documents and Settings\wblincoe
    VSEDEFLOGDIR=C:\Documents and Settings\All Users\Application Data\McAfee\DesktopProtection
    windir=C:\WINDOWS

  • Error when running a bat file

    Can someone tell me what this error means; "ORA-12560: TNS:protocol adapter error"
    I had Oracle XE on my Windows XP Pro SP3, but I also install the EE of Oracle which I haven't setup yet. Originally when I run this .bat file by double clicking on it, "setup_distran_database.bat", everything worked fine. But now, I am getting tghe above error. Not sure if it was because I installed Oracle EE.
    This is the .bat file:
    *@ECHO off*
    *:: Ayo Ojikutu*
    *:: Using Murach's Oracle SQL and PL/SQL*
    *:: and Mike Murach & Associates, Inc. example*
    *:: Nov 11, 2011*
    *:: Uses SQL*Plus utility to run the SQL scripts that create*
    *:: and populate the tables in the AP, OM, and EX schemas.*
    *:: If necessary, edit the username/password*
    sqlplus system/passwordhere @setup_distran_database*
    *:: Display a message about the log file*
    ECHO.
    ECHO For details, check the setup_distran_database.log file in the current directory.
    ECHO.
    *:: Display 'press any key to continue' message*
    PAUSE

    "ORA-12560: TNS:protocol adapter error"
    Not sure if it was because I installed Oracle EE.Most probably yes, Windows has the last installed product environment. Try setting XE environment before running sqlplus, something likeset ORACLE_SID=XE
    set ORACLE_HOME=<XE Oracle Home>
    set PATH=<XE Oracle Home\bin>;%PATH%
    sqlplus .....

  • Run tricky bat files

    I am trying to run a bat file which also runs a ksh script;The bat file is a bit tricky because it contains the following:
    set PATH=%CYGWIN_PATH_AGL%\bin;%PATH%
    %NUTC_PATH_AGL%\sh -c a.ksh %1 %2 %3 %4 %5 %6 %7 %8 %9
    These lines call Nutcracker, which is a UNIX-simulator on WindowsXP;
    When I double-click the bat file,it runs ok...but:when i try to call it with:
    try
    Runtime runtime = Runtime.getRuntime();
    String[] cmd =
    {"D:/Documents and Settings/stud6/jbproject/untitled3/a.bat"};
    Process p =runtime.exec(cmd);
    catch(Exception ex)
    ex.printStackTrace();
    ...it does absolutely nothing!
    Running an usual bat file also works fine;
    Please help me!Thanks in advance!

    ...it does absolutely nothing!It does something, just not what you thought it would. It probably aborts with a "bad command or filename", since you need the command shell to run a batch file.

  • Trying to run a bat file from oracle

    I have followed these steps, see bottom for results, everything is valid but the bat file does not run???? PLease need your help. Doug
    CREATE OR REPLACE AND COMPILE JAVA SOURCE NAMED "getbatx" AS
    class getbatx //class pdfopen
    public static void execmd(String c) //main function
    try
    System.out.println("Executing:" + c);
    Runtime.getRuntime().exec("C:\\WINDOWS\\system32
    cmd.exe /c "+c);
    System.out.println("Executing:" + c + " ...done");
    } catch (Exception e) //catch any exceptions here
    System.out.println("Error" + e ); //print the error
    CREATE OR REPLACE PROCEDURE host_command2 (p_command IN VARCHAR2)
    AS LANGUAGE JAVA
    NAME 'getbatx.execmd (java.lang.String)';
    /Then as sysdba I put in in the following.
    exec dbms_java.grant_permission( 'CAPRS', 'SYS:java.io.FilePermission', '<<ALL FILES>>', 'execute' );
    EXEC Dbms_Java.Grant_Permission('CAPRS', 'SYS:java.lang.RuntimePermission', 'writeFileDescriptor', '');
    EXEC Dbms_Java.Grant_Permission('CAPRS', 'SYS:java.lang.RuntimePermission', 'readFileDescriptor', '');Then I make the call.
    SET SERVEROUTPUT ON SIZE 1000000
    CALL DBMS_JAVA.SET_OUTPUT(1000000);
    BEGIN
    host_command2 (p_command => 'c:\mybook.bat');
    END;
    /***** I run this, it completes but does not run the bat file and there is no error message
    SQL> BEGIN
    2 host_command2 (p_command => 'mybook.bat');
    3 END;
    4 /
    Executing:mybook.bat
    Executing:mybook.bat ...done
    PL/SQL procedure successfully completed.

    Yes it should open a dos box, but you forgot to add the .bat file witch you like to run: String[] command = {"cmd", "/c", "start", "c:/Batch files/Cardiobackup/cardiobackup_v1.4"}

  • Not able to view the window when I run cim.bat file

    I have installed ATG web Commerce 10.0.3 and I need to configure MySql. For that I need to Start CIM by running the following file: <ATGdir>\home\bin\cim.bat and later I have to Type P to choose the products to configure, at a minimum ATG Platform and ATG Content Administration. But when I am not able to view the window to proceed further when I run thecim.bat file.Please let me know if anyone has any idea about this.

    Hi,
    Please find the error log while running in the command prompt.
    C:\Documents and Settings\******>c:\ATG\ATG10.0.3\home\bin\cim.bat
    Exception in thread "main" java.lang.UnsupportedClassVersionError: Bad version n
    umber in .class file
    at java.lang.ClassLoader.defineClass1(Native Method)
    at java.lang.ClassLoader.defineClass(ClassLoader.java:620)
    at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:12
    4)
    at java.net.URLClassLoader.defineClass(URLClassLoader.java:260)
    at java.net.URLClassLoader.access$100(URLClassLoader.java:56)
    at java.net.URLClassLoader$1.run(URLClassLoader.java:195)
    at java.security.AccessController.doPrivileged(Native Method)
    at java.net.URLClassLoader.findClass(URLClassLoader.java:188)
    at java.lang.ClassLoader.loadClass(ClassLoader.java:306)
    at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:268)
    at java.lang.ClassLoader.loadClass(ClassLoader.java:251)
    at atg.core.util.BeanUtils.instantiate(BeanUtils.java:427)
    at atg.core.util.BeanUtils.getBeanInfo(BeanUtils.java:395)
    at atg.nucleus.SimpleComponentState.getComponentClassDescriptor(SimpleCo
    mponentState.java:547)
    at atg.nucleus.SimpleComponentState.<init>(SimpleComponentState.java:91)
    at atg.nucleus.SimpleConfigurationState.<init>(SimpleConfigurationState.
    java:93)
    at atg.nucleus.PropertyConfiguration.configureService(PropertyConfigurat
    ion.java:756)
    at atg.nucleus.Nucleus.<init>(Nucleus.java:832)
    at atg.nucleus.Nucleus.<init>(Nucleus.java:717)
    at atg.nucleus.Nucleus.startNucleusCheckLicense(Nucleus.java:4144)
    at atg.nucleus.Nucleus.startNucleus(Nucleus.java:4021)
    at atg.cim.SessionContext.startNucleus(SessionContext.java:632)
    at atg.cim.SessionContext.startNucleus(SessionContext.java:610)
    at atg.cim.flow.CimFlowCreator.startDefaultCimFlow(CimFlowCreator.java:7
    4)
    at atg.cim.Launcher.startCimFlow(Launcher.java:168)
    at atg.cim.Launcher.main(Launcher.java:68)

  • Getting "Unable to run script at line 1: syntax error"  error?

    Hi,
    I want to run a script using the AEGP_ExecuteScript() function. but I got an error "Unable to run script at line 1: syntax error". what could be the rea son for this? shall I inlcude anything extra info in my project?
    Below is the code ...
    char scriptPath[] = "F:\\Documents and Settings\\akshays\\Desktop \\Active Shutter.jsx";
    A_Boolean platform_encodingB = 'B';
    AEGP_MemHandle outResultPH0;
    AEGP_MemHandle outErrorStringPH0;
    utilitySuite5->AEGP_ExecuteScript( pluginID, scriptPath, platform_encodingB, &outResultPH0, &outErrorStringPH0 );
    please help me.
    Thanks
    Manjunath

    This can be debug by using "ExtendSCript Toolkit 2 and Debugger".
    Just open Edit -> Prefernces -> General -> ****
    There enable checkbox "Enable javascript debugger".
    if you encountering an error while launching the script, then AE will automatically open your script in "ExtendSCript" toolkit with an error at the bottom line. You can see the "DataBrowsing" panel right side for available functions., objects and so on.
    then you can get to know what is the error and the reason for this error at least.

  • How to run a .bat file with string arguments?

    Hi,
    I have a problem in running a .bat file with string arguments
    - the file is XPathOverlap.bat with 2 stringarguments like: "/a" and "//a"
    - the cmd: c:\Downloads>XPathOverlap "//a" "/a" works fine.
    - here is my code:
    public static void test(){
         try{
              String loc1 = "//a";
              String loc2 = "/a";
              String[] cmdarray = {"c:\Downloads\XPathOverlap", loc1, loc2};
              Process p = Runtime.getRuntime().exec(cmdarray);
              p.waitFor();
              System.out.println("Exit Value: "+p.exitValue());
              //code to print command line replies
              InputStream cmdReply = p.getInputStream();
              InputStreamReader isr = new InputStreamReader(cmdReply);
              BufferedReader br = new BufferedReader(isr);
              String line = null;
              while((line=br.readLine())!=null){
                   System.out.println(line);
         }catch(Throwable t){
              t.printStackTrace();
    How can i run this bat file with 2 string arguments?

    Hi,
    thanks thats good and helpfully
    so this code works:
    String loc1 = "\"/a\"";
    String loc2 = "\"//a\"";
    String path = System.getenv("MuSatSolver");
    String[] cmdarray = {"cmd.exe","/C",path+"XPathOverlap.bat", loc1, loc2};
    Process p = Runtime.getRuntime().exec(cmdarray);
    p.waitFor();
    System.out.println("Exit Value: "+p.exitValue());
    InputStream cmdErr = p.getErrorStream();
    InputStreamReader isrErr = new InputStreamReader(cmdErr);
    BufferedReader brErr = new BufferedReader(isrErr);
    String line2 = null;
    while((line2=brErr.readLine())!=null){
         System.out.println("Error: "+line2);
    but now i have another problem, this is the output:
    Exit Value: 0
    Error: java.lang.NoClassDefFoundError: fr/inrialpes/wam/treelogic/_xml/XPathOverlap
    Error: Exception in thread "main" The Exit value is 0, so the process terminates normally.
    I have tested this bat file in cmd and there it works correctly.
    Why do i get this error message?

  • Scripting file copy to windows server

    Hi all,
    We need the ability to copy files from the Mac G5's running 10.4.x to a windows based server (2003) across our LAN. Looked at scripting Terminal but it does not seem to support apple script the way I would like - ie copy /file to //server.
    The reason we need to do the copy like this is to prevent resource forks and the .ds_store from coping as well, more of a unix copy. These hidden files are really messing up the system we are coping to (SQL DB).
    Any suggestions?
    Thanks in advance
    Bill

    I don't know enough about Visual Basic to feel
    competant to run a script to do this. I disagree with
    the statement that there is "nothing to fix" however.
    These dot files litter our Windows server and even
    with Blue Harvest running I am constantly having to
    use the Server Management Console to close these dot
    files so that our real files can be moved, copied, or
    deleted because when the server sees these as open it
    sees the real file as open even when it isn't.
    I had the option of FSM (File Services for Macintosh)
    with the server, but we have thousands of files that
    would have to revert back to 31 character filenames.
    Rather than do that, I chose to stick with the SMB
    protocol. It's a right pain getting it to work and
    then we have the dot files on top of it. It wouldn't
    be an issue with a Mac server, but I don't have one.
    So, in my view Apple still has not fixed this.
    I'm glad I asked the question though, because I made
    the assumption that Tiger fixed this. Since it hasn't
    I have yet another reason to stay in Panther.
    And what happens with the files that still need resource forks? They're are still a Mac applications out there that make use of metadata. How are you going to selectively decide which metadata to preserve? Have ever had to help a user whose files suddenly turned into "unix executable" files after copying them to a server? You'll quickly realize that there are instances when metadata must be preserved.

  • Aerender error: "Unable to execute script at line 95. Window does not have a constructor"

    A BG Renderer user is getting this error when running aerender version 10.5.1x2:
    "Unable to execute script at line 95. Window does not have a constructor"
    The render proceeds but the process never completes which is preventing the rest of the BG Renderer notifications from triggering.  Any idea what this error means and how to fix it?
    Thanks,
    Lloyd

    I guess we'll have to wait for Adobe to answer what could be causing the transmission to drop on Line 95. Todd's out of the office for a month or two, but maybe someone else can shed some light.

  • How do i run a Labview file through a windows phone?

    Hello there
    How do i run a Labview file through a windows phone or a tablet? is it possible
    is there any phone specifications required? or steps?
    Thanks alot  

    Blokk wrote:
    na1992 wrote:
    hahaha my baad
    i mean if i have done my labview file on laptop and i want it to connect my file to a microcontroler using usb or any serial connection, i want a way that my labview file will run if i store it on a phone. 
     i searhced about exe  format but i didnt find enough info
    Sorry, but you should define more precisely what is your goal:
    " i searhced about exe  format but i didnt find enough info"
    If you build an exe using Labview, that exe will not run on iOS, or Android, if this is what you ask...
    Nor Windows Phone or Windows RT. A LabVIEW exe is compiled and linked for x86 or AMD64 architecture with Win32 API architecture and will only run on Windows for x86 or x64 systems.
    Windows Phone and Windows RT are despite the similarity in the name technically completely different platforms to the normal Desktop Windows system, just as different as MacOS X or iOS.
    Rolf Kalbermatter
    CIT Engineering Netherlands
    a division of Test & Measurement Solutions

  • Transfering data from oracle table to a file on a windows server

    Hi
    I have an oracle DB version 11.2 running on oracle enterprize linux 5.9. I would much appreciate an suggestions on how to transfer data from the oracle DB to a flat file on a windows server.
    What i have done so far is to use utl_file to create a csv file on the oracle server and am now attempting to transfer this file. I was going to use scp or rcp but am unable to get this to work(was looking at filezilla). Another option i can use is ftp as i have a unix script which i can run to do this. All this is done through an oracle package which is run hourly through dbms_scheduler. I have been using sp_host_command to run unix commands directly from pl/sql so can use this to run a unix script for last resort if i cant find an easier way to automate this.
    Any suggestions or options would be much appreciated.
    Cheers
    Gary

    Well, using DBMS_SCHEDULER you can run o/s commands so you could use that to do your FTP or whatever to move the file.
    Alternatively, you could write your own FTP package using the built in UTL_TCP package, or you can get hold of one of the freebie packages people have made available to do the same e.g.
    ORACLE-BASE - FTP From PL/SQL in Oracle in Oracle

  • IDOC to File Port on Windows Server from Unix SAP System

    Hi All:
    I want to use an IDOC to create a text file on a Windows server. The SAP system runs on Unix. I have no problem creating the text file on the same Unix server running the SAP instance but I can not figure out how to write the file to a share or UNC path on a Windows server. I tried to create a logical file path using transaction FILE and then create a logical port in WE21. The IDOC failed because it is still looking on the Unix server to write the file. Any ideas from the community would be greatly appreciated.

    Hmmm, there are probably lots of ways to skin this cat.
    To make the process asynchronous you probably want to be along the lines of either updating a table or placing a file on the Windows machine, and then having a database process or Windows program to watch for the file or database table entry and triggering your bat file when it appears.

Maybe you are looking for

  • How do you get to verify ID if ICloud won't let the owner in

    I would like to know? As a first time owner of an Apple device, how is it possible to verify your account in your ICloud email address, when you cannot login into it, though I am logged in here and logged into Apple home page that I could get this fa

  • Itunes library both on external hard drive and mac.

    Hello. I wish you could help me. I transfered my itunes library to an external hard drive. However, there are times that I would forget to put it back on. Now, there are some files that itunes can't locate. How do I back up the new files i have on my

  • Unable to verify Digital Signature in workspace

    Hi All, I m trying to use VerifyPDFSignature DSC from Digital Signitures. The process works fine when i invoke it from the workbench but i am unable to get it working from the workspace. So i guess that must have something to do with the rendering se

  • Fpga HDL code generator

        Hello, It seems that FPGA module cannot interface custom FPGA board. I wonder if FPGA can be used as a HDL code generator. Here is what I'd like to do : - code an algorithm in a LabVIEW block diagram - make a HDL from the BG with FPGA module - bu

  • Is there a way to delete newstand?

    I think me and a million other people agree that the new newstand feature freaking ***!!!!It just takes up space and no one wants to even buy the subscriptions just check the reviews it's horrible. I love every update apple ever made but this newstan