How to run a .bat code?

how to run a .bat code?
I have a code ,batch (.bat) in richtextbox1, and want , to text(code .bat) in richtextbox1 it was launched in the console cmd
without the use of saving a file with this code and run it

In your code, right-click on the word "Desktop". In the context menu, select "go to definition". The object browser opens. You will see other members of the SpecialFolder enum. You can examine these values and read the description below.
One of them is "ProgramFiles". If you pass this value to GetFolderPath, it returns the path of the program files.
Another way: In your code, move the caret to the word "desktop" and press Ctr+J. It will open the same list of enum values. Whenever you select an item in the list, the tooltip should also show a description of the enum value.
Then look at
System.IO.Path.Combine to combine the program files path with the sub folder path. The result will be the full path of the directory. You can call Path.Combine for every path name or file name that you want to add.
Armin

Similar Messages

  • How to run the Transaction Code - BIC for Bank keys uploading

    Hi
    How to run the Transaction Code - BIC for Bank keys uploading.
    please give me suggestion.
    Thanks
    Indu

    Go to BIC transaction screen
    Fill the selection screen parameters as below
    1. Update Run (Test Run: Check Off: Real Run:Check On)
    2. Set Deletion Flag (Check On)
    3. Maximum no. of records: 999999
    4. Detail List (Check On)
    5. Display variant: 1SAP
    6. Presentation server (Select Radio Button)
    7. Application server (Deselcet Radio button)
    8. File name and Path: Select relavant file which is to be upload
    9. Bank country: If needed (Give respective country name)
    10. Select execute button or F8
    NOTE: Make sure that before executing run execute TEST RUN by deselecting Update Run check box
    Hope this will meet your requirement
    Thanks.

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

  • How to run the sample code using the sdk?

    Hi,
    I want to run the jsp code from the enterprize sdk available in the sdn community. Can any one tell me how to execute these jsp sample codes and what is the pre-requisite regarding the set up.
    I already have the deployment ready.
    thanks
    AMar

    Hi Amar,
    To execute samples code, it is same what is required for normal J2EE application.
    Make sure add all the jars to your web application.
    These jars can be found on your BO server installation if windows.
    For BOE XI 3.x
    C:\Program Files\Business Objects\common\4.0\java\lib
    C:\Program Files\Business Objects\common\4.0\java\lib\external
    For BOE XI R2
    C:\Program Files\Business Objects\common\3.5\java\lib
    C:\Program Files\Business Objects\common\3.5\java\lib\external
    Thanks,
    Praveen.

  • How to run netbeans swing code without netbeans

    hi
    i created a GUI use netbeans and it compiles and runs under netbeans. my question is how can i run it on a machine doesnt have netbeans. i realise that in the netbeans project scr file, there s two .java file, but have no idea how should run it. i tried to do
    javac <GUI class name>.java
    but got lots of erro like this:
    GUI_main.java:545: package org.jdesktop.layout does not exist
    jPanel20Layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
    how can i do it corectly???
    dav

    Hai,
    u need to search the Classes ur using in netbeans installation directory
    i.e., org.jdesktop.layout some class.
    May i know y ur using org.jdesktop.layout package
    From where u got GroupLayout. Search GroupLayout.class and set the classpath.
    javac -classpath <path of the class files>
    regards,
    RdRose.

  • How to run adt.bat created installer silently from command line?

    All,
    I totally get how to create an installer like so:
    adt -package -target native c:\AirExe\myApp.exe c:\AirExe\myAirApp.air
    Is it possible to run the installer silently from the command line?  Part of our smoke test process is to do nightly builds which would include the adt command above.  What we're missing right now is automatically copying the installer to a QA machine and silently install from the command line.  Currently, we have a QA engineer manually running the GUI installer.
    We want to automate as much of our process as possible and without installing silently from the command line, we're kind of dead in the water for automating this process.  Thanks...
    Matt

    Spent an hour last Friday on hold with Adobe support, bounced around to 4 different CSR's and no love getting my question answered.
    I spent part of my weekend solving this.  I'm sure there are other solutions, but here goes:
    1) Downloaded the 7-Zip utility from here: http://www.7-zip.org/
    2) Added c:/Program Files/7-Zip to my path (this helped with interactive testing from the command line)
    3) Made the following edit to my ant build.properties file:
         a) 7_ZIP_HOME=C:/Program Files/7-Zip
    4) Made the following edit to my ant build.xml file:
         a) <exec executable="${7_ZIP_HOME}/7z.exe">
               <arg line="x build/INSTALLER_CREATED_WITH_ADT.exe -obuild -y"/>
             </exec>
    Hope this saves someone else a little time...
    -M    

  • How to run a bat file in java

    Hi, my program needs to use an outside batch file command, for instance, its name is "generateXML", its syntax is
    [command prompt] : generateXML sourceFile.dtd XMLFile.xml
    I want to include this command into my code so that do that and other things at one go.
    Thanks

    On Windows 98 try something like this:
    Process process = Runtime.getRuntime().exec( "command.com /c generateXML sourceFile.dtd XMLFile.xml" );

  • How to run javascript step by step

    I write a javascript function.
    I want to the javascript can run line by line. For example, after finishing sumbit, then, it will run following code. However, the form is big, and saving variables to database need time. Therefore, rest code run before database finish saving form variables.
    How to run the rest code after database finish transactions?
    function processSaveZB(){
              document.getElementById("businessForm").action="${pageContext.request.contextPath}/pages/compreApp/compreApp_createGdjbxxzb.action";
              document.getElementById("businessForm").submit();           
              for(var v=0; v<allrows.length; v++){
                   var url='${pageContext.request.contextPath}/pages/compreApp/compreApp_createTdytNew.action';
    ...........run action......................
    window.close();
    }

    I write a javascript function.Then you're in the wrong place. This is a Java Programming forum, not JavaScript. Locking.

  • Running Applescript /VBScript code using NativeProcess

    I know how to run a script file using NativeProcess, but I can't seem to figure out how to run pure script code.
    Is there any way to run AppleScript and VBScript code without first saving it to a file?
    Harbs

    The script is the same. What do you mean your suspicion of executing AppleScriptObjC is wrong?
    Macbook pro, fully up to date.
    See the first 2 posts in this thread for the crashes. When I comment out the error code it doesn't crash. Rather, Xcode logs
    Runtime error in script: (null)
    Else, the app crashes pointing to thread 1. Specifically the app stops on the error part of the method. Here is exactly what I'm seeing:
    EDIT:
    I just printing the scripts path to the console to check if it's being included in the app bundle, which it is. 

  • How to call a .bat file from java code?

    How to call a .bat file from java code? and how can i pass parameters to that .bat file?
    Thanks in advance

    thanks for ur reply
    but still i am getting the same error.
    I am trying to run a .bat file of together tool, my code looks like below
    import java.lang.Runtime;
    import java.lang.Process;
    import java.io.File;
    class SysCall{
         public static void main(String args[]){
              String cmd="D://Borland//Together6.2//bin//Together.bat -script:com.togethersoft.modules.qa.QA -metrics out:D://MySamples//Metrics// -fmt:html D://Borland//Together6.2//samples//java//CashSales//CashSales.tpr";
              //String path="D://Borland//Together6.2//bin//Together.bat ";
              Runtime r= Runtime.getRuntime(); //Declare the system call
              try{
                   System.out.println("Before batch is called");
                   Process p=r.exec(cmd);
                   System.out.println(" Exit value =" + p.exitValue());
                   System.out.println("After batch is called");
              /*can produce errors which must be caught*/
              catch(Exception e) {
                   e.printStackTrace();
                   System.out.println (e.toString());
    I am getting the below exception
    Before batch is called
    java.lang.IllegalThreadStateException: process has not exited
    at java.lang.Win32Process.exitValue(Native Method)
    at SysCall.main(SysCall.java:17)
    java.lang.IllegalThreadStateException: process has not exited

  • How to run sql query in bat file in task schedular at every 10 seconds

    This is my sql script :
    DECLARE @countRows INT,
    @currDate DATE,
    @checkForTasks INT,
    @created_by_id INT,
    @gst_ID int;
    SET @currDate = Getdate()
    SET @countRows = (SELECT Count(*)
    FROM [dbo].[sd_gst_effective_table]
    WHERE isapplied = 0)
    IF @countRows > 0
    -- Check for those GST''s who are not applied yet : if they are greater than 0 then perform next task
    BEGIN
    SET @checkForTasks = (SELECT Count(*)
    -- Check is current date equals to task date or not
    FROM [dbo].[sd_gst_effective_table]
    WHERE effect_date = @currDate AND isapplied = 0)
    IF @checkForTasks > 0
    -- If current date = task date then perform this task
    BEGIN
    SET @created_by_id = (SELECT TOP 1 createdby FROM [dbo].[sd_gst_effective_table] WHERE effect_date = @currDate AND isapplied = 0)
    SET @gst_ID = (SELECT gst_id FROM [dbo].[sd_gst_effective_table] WHERE effect_date = @currDate AND isapplied = 0)
    -- STEP 1 :: InActivate the existing GST according to createdbyID
    UPDATE sd_gst_rate
    SET isactive = 0,
    inactivedate = Getdate()
    WHERE isactive = 1
    AND createdby = @created_by_id
    -- STEP 2 :: Activate the New GST according to implementation date and gstID
    UPDATE sd_gst_rate
    SET isactive = 1,
    activedate = Getdate()
    WHERE id = @gst_ID
    -- STEP 3 :: Inactivate the applied GST from sd_gst_effective_table
    UPDATE [dbo].[sd_gst_effective_table] SET isApplied = 1 WHERE gst_id = @gst_ID
    END
    END
    DECLARE @Text AS VARCHAR(100)
    DECLARE @Cmd AS VARCHAR(100)
    DECLARE @value nvarchar(1000);
    SET @value = (SELECT CONVERT(TIME,GETDATE()) AS HourMinuteSeconds);
    SET @Text = 'File Writed ' + @value
    SET @Cmd ='echo ' + @Text + ' > E:\AppTextFile.txt'
    EXECUTE Master.dbo.xp_CmdShell @Cmd
    This is resided in videos folder of windows , i have created a task schedular in windows 8.1 to run daily at every 10 seconds , but it is not working ... Please tell me how to deal with it.
    Please note : This sql query is running perfectly in sql server. Query have no errors. Please check whats wrong with my time schedular. I just want my schedular to run every 10 seconds regardless of date.

    Hi Emad,
    Is your script in a ".sql" file? May I know how you configure the schedule task action?
    Since you didn't mention how you configure the schedule task, can you confirm you have followed the below step correctly?
    Save your script in a ".sql" file.
    Create a ".bat" file and call the sql file above inside with
    sqlcmd.exe, you can reference
    here.
    Configure a schedule task to run the ".bat" file in a certain interval.
    Have you tried to run the script in you bat file in a standalone commandline window? Please post the script in your bat file, It can help to diagnose the issue.
    If you have any question, feel free to let me know.
    Eric Zhang
    TechNet Community Support

  • How to run a cygwin.bat from a java program?

    Can you please let me know how to run a cygwin.bat file from a java program and to give commands through java program. I have a program to run .exe files, but when I do the same for the cygwin.bat it doesnt work. In task mgr a BASH and a cmd.exe is running. Please help me on this & bit urgent. Thanks in advance!

    Can you please let me know how to run a cygwin.bat
    file from a java program and to give commands through
    java program. I have a program to run .exe files, but
    when I do the same for the cygwin.bat it doesnt work.Of course not. .bat files are no native executables. You need to open a shell first, like "cmd /c cygwin.bat ..."
    & bit urgent. Thanks in advance!If I had read this earlier I wouldn't have replied. Why exactly is your time worth more than anybody else's?

  • How to run a command line window from code?

    In an application I need to run a dll file with a few arguements. These arguements can be given in the command line window. The execution of the dll file will return a string that i need to get (for the parsing etc).
    1. How can I open a command line window from the Java code?
    2. How to run commands on it?
    3. How to get the results of the commands from the command line into my program?

    In an application I need to run a dll file with a few
    arguements. These arguements can be given in the
    command line window. The execution of the dll file
    will return a string that i need to get (for the
    parsing etc).
    A dll is used by other programs. It is not possible to run it from the command line.

  • How to run the code generator

    I urgently need to know how to run the code generator using creator. Can anyone assist? I cant find any tips in the forums.

    I am following the procedure to create a new custom component (or extend an existing component) available at http://developers.sun.com/prodtech/javatools/jscreator/reference/techart/2/writing_custom_components.html.
    Part of the procedure says: you need to use the JSC to run the code generator based on sun-faces-config.xml metadata.

  • How to run the open script code from eclipse?

    Hi,
    How to run the open script code from eclipse.
    Please let me any soulutions on this.

    Hi Konda
    I am not quite sure you can do that and it would even be not supported... Again, what is the purpose? Why do you want to run your openscript code in Eclipse?
    What is the code you try to run?
    As an example, even if you include al the jar files and so on. don't think the function "Launch Browser" could work because it isn't only java code orjar files.....
    If you give us more background. maybe we can guide you to a better solution...
    JB

Maybe you are looking for

  • Javax.servlet..ServletException in jaser report in jsp page

    Hi all, In my web application i am using jasperreport 3.0. to generate reports in excel format My Application is configured in apache-tomcat-5.5.26 in Mac Server. I have placed the following jar files in webapps/xxxx/WEB-INF/lib. jasperreports-3.0.0.

  • New computer how can I get my old purchases on the new computer?

    I got a new computer, but don't know how to get my itunes to transfer my purchases over to new computer and don't want to lose all my music... can someone help?

  • Gray screen after try to install 2 os in macbook pro

    Hi, I tried to isntall 2 mac os in my mac book pro and end up without  os in mac book now my machine is starting with sartup sound but after this it is reaching to gray screen and not going ahead. I hold the option key at time of sarting, my mac book

  • Process of incoming mails including Excel attachment

    Hello Forum, we are looking for a possibility to process incoming e-mails including an Excel attachment. We are already able to receive e-mails in SAP, but we are not able to process/read the attachment in Excel format. I already checked the blogs of

  • Problem in PO output re-issue

    Hi, I am working on the PO Smartform. Whenever the specified print related field values are changed in PO, system should repat the output type with change flag and print only those line items which are changed. In the print program the Function Modul