How create bath file in run time in java

Hi all
i run one bath file by using process class but i create bath file in run time in java .please help me with code.

Dynamically Writing a batch file in Java is exactly the same as writing to a simple text file.... you just give it the file extension ".bat".
If you can't write to a simple text file yet, you should probably buy a Java book and start working through it.
regards,
Owen

Similar Messages

  • How to open directory in run time using java

    Hi All
    i hava problem for open a directory in run time in java.please help me with code.

    Please elaborate what you mean by opening a directory. You can at all times access directory content via the File class.
    File myDir=new File(<pathToDir>);
    File[] directoryContent=myDir.listFiles();

  • How to create transparent image at run-time?

    How to create transparent image at run-time? I mean I want to create a (new) transparent image1, then show other (loaded) transparent image2 to image1, then show image1 to a DC. The problem is - image1 has non-transparent background...

    i'm not sure, but you can set the alpha value to 0 in all pixels which are 'in' the background..
    greetz
    chris

  • How to get info from a .class file at run time? thanks for help

    I need to get methods and properties (variables) from a .class file at run time.
    as u know, javap.exe can do that in an independent way. but i need to get info at run time once the .class or packeges have been changed, javap is not suitable in the case.
    i try to read data directly from .class file but it's hard to know the file format.
    e.g. a class looks like (java file):
    class MyClass extends Frame
    int i0;
    String s0;
    public String getName()
    if the file is compiled to .class file, how to get properties (variables: i0,s0) and methods String getName() from the .class file by an applicaton at run time?
    Doclet is not suitable for speed reason, it is too slow to get right info in right format.
    Thanks for any help, please write a little bit more in detail if you know.

    Use the Java Reflection API. Have a look at the Reflection section of the Java Tutorial located at http://java.sun.com/docs/books/tutorial/reflect/index.html

  • Modifying property file at run time

    Hi all..
    I have been using properties file for handling few configurations in my project.
    whenever i need a change in the file, i had to change it in corresponding file, create a jar file and then introspect it into project and then publish the project.
    Is there any other way of achieving it.... can we modify the property file at run time just like we do for JSP pages...
    Or any other better way of doing this.. pls suggest..
    (am using 10g OBPM)
    Have a nice time...
    Regds,
    Viswanath

    Sharma,
    write a java class that reads a property file from the external path. make the jar file non-versionable in case you need to update that later. if you are on J2ee container all you need to do it drop the file @ domain root and u shd be good to go.
    sample code I am doing this for log4j.properties and application propertied.
    public class BPMLoggerUtil {
         // Initializing the default Logger //
         private static Logger logger = null;
         private static final String DEFAULT_PATH = "resources/log4j.properties";
         private static HashMap map = new HashMap();
         * This is the init method
         * @param propertyPath
         public static void init(String propertyPath){
              try {
                   if((logger = (Logger) map.get(propertyPath)) == null){
                        Properties properties = new Properties();
                        properties.load(LoggerUtil.class.getClassLoader().getResourceAsStream(propertyPath));
                        PropertyConfigurator.configure(properties);
                        logger = Logger.getLogger(PropertiesHelper.getProperty("resources.test", "AppName"));
                        map.put(propertyPath, logger);
              } catch(Exception ex) {
                   ex.printStackTrace();
         }

  • Convert standard video files in to flv file at run time

    Hello All
    How can we convert standard video files in to flv file at run
    time like
    you tube and
    Google Video is there any
    script or tool to do this. This is urgent.
    I have one project in this project client requiring function
    like whatever standard video file he upload, it will be play in
    .flv formate
    Any help is appreciated
    Naved Ansari

    I think you need the Macromedia Flash Media Server to be able
    to do what you are asking. Flash 8 can with a Flash Video Encoder
    but it does not do it on the fly. There maybe other 3rd party
    servers that you can sign-up that allow you do this but if you are
    looking for your own solution you will need the FMS 2.0.
    Tim

  • Create the pages at run time in smartforms

    How to create the pages at run time in smartforms????

    Hi..
    You cannot create pages at run time, however you can decide based upon conditions and using commands in Smartforms, which page needs to be displayed next.
    Those pages should be created beforehand.
    Regards,
    Karthik

  • Opening Another Flash File during Run Time

    I know, this is too easy. How do I open a Flash.exe file
    during run time? I know the code below is wrong but some insert the
    correction?
    open_btn.onRelease = function () {
    play("C:\Documents and Settings\GameOfficeFlow.exe");}
    Forever in your debt,
    Mike

    play() is a timeline command.
    I don't think you can have Flash load/play an exe file, but
    wait awhile and see if someone else knows better on that one. You
    can have it load/play an swf version of a Flash file though.

  • How create header with user id time date to VC-report's output as display ?

    How create header with user id time date to VC-report's output as display ?
    This info should come from the VC - not all the way from R3-side via FunctionModule/BABI. So only userid, date, time to output as normal text (which is not editable of course). Thanks =)

    Hi ann-mari
    Go through following link may it help u
    Form Item disabled based on portal role
    /people/community.user/blog/2007/01/17/visual-composer-explorations-using-portal-roles-to-influence-ui-element-behavior
    https://www.sdn.sap.com/irj/sdn/wiki?path=/display/vc/usingrolestoinfluenceapplication&
    https://www.sdn.sap.com/irj/sdn/wiki?path=/display/vc/passingvaluesvia+URL&
    https://www.sdn.sap.com/irj/servlet/prt/portal/prtroot/docs/library/uuid/ad182ac7-0a01-0010-4fb8-8a4d217b19c1
    Best Regards
    ````Satish````

  • Is it possible to create a column in run time?

    Hi,
    I created a application that connect with Access database. I just wonder is it possible for user to create a column in run time, because the application need this kind of interaction.
    Many thanks,
    Ann

    Code that does it is here:
    http://forum.java.sun.com/thread.jsp?forum=48&thread=453846&tstart=0&trange=15
    MOD

  • How can I test the running time of a method?

    c.What is the running time of your method smallest, as a function of n, the number of elements in the list? Use big-Oh notation.
    I quoated from a java problem..
    Anyone can tell me how I can test the running time? Thanks ! :D

    it depends on what is in the method. For example a for loop executed n times would have a O(n). A double for loop (each loopp run n times) will have O(n^2). Do this: determine how many times each loop in the method is run. This is the first term in your runtime equation. Do this for all other loops in the method and add them all together. Most other statements that are not iterative should have a constant runtime so O(1). For conditional statements, the runtime depends on the most time consuming portion of the statement. Once all these are added together, take the O(equation) which should just leave the biggest term. i.e. O(5n^2+3n+8) = O(n^2). Hope this helps.
    note: this does not apply to recursive methods

  • How to avoid the run time error  "java.lang.OutOfMemoryError"

    hi
    i have written a code to read a txt file ,i used FileReader to read a file . the code is working well for small txt files. but when i tried to read a large file(greater than 2MB), a run time error called "java.lang.OutofMemoryError" appeared .
    plz suggest the methods to read txt files of large capacity(greater than 25MB) .if possible give an example.

    thanks for ur replies
    i am new to java programming .i am a student persuing B.Tech final semester .i got struck in my project while reading a large txt file(greater than 3MB) . i am now giving a part of code that i had used in my project .it working fine with the txt files less than 3MB ,but when i am treing to read a file greater than 3MB , it is displaying a run time error "java.lang.outofmemoryerror"
    i have tried using "java -Xmx" ,it is working , but is there any better option ??
    here is the part of code:
       FileReader fin;
        al=new ArrayList();
         try
              fin=new FileReader(filename);
         catch(FileNotFoundException e)
           System.out.println("File not foumn");
         return;
    while((i=fin.read())!=-1)
           al.add(new Character((char)i));
         fin.close(); 
         Object obj[]=al.toArray();plz help me
    --santosh                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                   

  • How create XML file

    How create XML file using HTML / JavaScript. Please small example.
    Mykle.

    Various tools are available generate an XML document from a DTD.
    http://www.eclipse.org/webtools/community/tutorials/XMLWizards/XMLWizards.html
    http://www.altova.com/products/xmlspy/dtd_editor.html
    http://www.stylusstudio.com/xml_generator.html

  • How to get the current GMT time in java

    Hi,
    How to get the current GMT time in java
    Thanks

    System.getCurrentTimeMillis() or new Date().
    [url http://www.javaworld.com/jw-12-2000/jw-1229-dates.html]Calculating Java dates: Take the time to learn how to create and use dates
    [url http://www.javaalmanac.com/egs/java.text/FormatDate.html]Formatting a Date Using a Custom Format

  • How can I calculate the total time in java?

    Hello!
    I need to calculate the total time!
    For example I have start time:
              Format formatter1;
              Date date1 = new Date();
              formatter1 = new SimpleDateFormat("hh:mm:ss");
              String startTime = formatter1.format(date1);
              //startTime = "14:20:40";
    And I have finish time:
              Format formatter2;
              Date date2 = new Date();
              formatter2 = new SimpleDateFormat("hh:mm:ss");
              String finishTime = formatter2.format(date2);
              //finishTime = "08:30:55";
    So, after manually calculating, I get total time: "18:10:15"
    How can I calculate the total time in java? (Using formatter1 and formatter2 I suppose)
    What I need is to print "total 18:10:15"
    Thanks!

    800512 wrote:
    I did the following but, I think something is wrong here:
    I defined before: Date date1 = new Date(); Date date2 = new Date();
    And it should be exactly 5 seconds between them.
    I found delta between date1 and date2:
    Format formatter = new SimpleDateFormat("HH:mm:ss");
              long timeInMilliFromStart = date1.getTime() - date2.getTime() ;
              Date date3 = new Date(timeInMilliFromStart);
              String timeInSecFromStart = formatter.format(date3);
    and I get always
    //timeInSecFromStart = 02:00:05
    But it should be exactly 00:00:05.
    What can be a problem?Because, like I said, a Date measure an instant in time, not a duration. So when you have 5000 ms, and you turn that into a Date, that means 5 sec. after the epoch, which works out to 1/1/1970 00:00:05.000 GMT.
    As I mentioned, if you're not currently in GMT, then you have to set the TZ of the DateFormat to GMT. Right now, it's showing you the time in your TZ. If you included the date in your SimpleDateFormat, you'd see either 1/1/1970 or 12/31/1969, depending on which TZ you're in.
    Bottom line: You're trying to use these classes in a way they're not meant for, and while you can get the results you want for a limited set of inputs if you understand what these classes do and how to work with that, it's a brittle approach and comes with all kinds of caveats.

Maybe you are looking for

  • Photoshop CC freezes and crashes on Mac OS 10.8

    Since a week ago, Photoshop CC suddenly became easily "frozen" when I use it on my iMac with Mac OS 10.8. Problems: - tools freeze - fail to show cropping tools and brushes properly - part of the top menu and side bars become white and empty - the sa

  • OEM 10g (10.2.0.1) Grid Control for Linux86 part 2

    Hi hussein/helios, Firstly.... How do you install management agent for linux86? I have already installed OEM 10g Grid Control OMS on my linux sever which also has EBS R12.1. Do I need to install a "management agent" on this server, to be able to mana

  • Weird Issue with swf in dreamweaver

    I need help, this is very frustrating- I have a flash file that when the mouse clicks it populates the UILoader. When I test my movie it works. When I publish preview html in flash it works. When I drag the .swf file onto any browser it works. The pr

  • Drag and Drop files to upload snag

    I am developing a Director projector application that uploads a users local files to a server via an FTP Xtra. I would like to have an icon on the desktop that the user can drag-and-drop files onto and the application automatically uploads the files.

  • I bought an iPhone from someone out of the paper and they didn't log out of their iCloud account.

    I Bought an iphone from someone out of the paper and they didn't log out of their icloud account. im not too sure how to fix this problem considering I cannot get in contact with them. so if someone could help me I would really appreciate it.