I want to run a site from batch file.

Hi,
I want to run a website from batch file.
Is this possible through batch file or say command prompt.
like I want to run
http://java.sun.com/
any help will be appriciated.
cheers
vjoy

Here is the code you need.
import java.awt.*;
import java.awt.event.*;
import java.io.*;
import java.util.*;
import javax.swing.*;
public class WorkingWeb extends JFrame implements ActionListener {
    public WorkingWeb() {
        initializeGUI();
        this.setVisible(true);
    public void actionPerformed(ActionEvent ae) {
        if (ae.getSource() == jbDone) {
            this.setVisible(false);
            this.dispose();
    private void initializeGUI() {
        int width = 400;
        int height = 300;
        this.setSize(width, height);
        this.getContentPane().setLayout(new BorderLayout());
        this.setTitle(String.valueOf(title));
        Dimension d = Toolkit.getDefaultToolkit().getScreenSize();
        Random rand = new Random();
        int x = rand.nextInt(d.width - width);
        int y = rand.nextInt(d.height - height);
        this.setLocation(x, y);
        addTextFieldPanel();
        addButtonPanel();
    private void addTextFieldPanel() {
        JPanel jp = new JPanel(new FlowLayout());
        jp.add(new JLabel(String.valueOf(title)));
        jp.add(jtfInput);
        this.getContentPane().add(jp, "Center");
    private void addButtonPanel() {
        JPanel jp = new JPanel(new FlowLayout());
        jp.add(jbDone);
        jbDone.addActionListener(this);
        this.getContentPane().add(jp, "South");
    public static void main(String args[]) {
        while (true){
            new WorkingWeb();           
    private char title[] = { 0x49, 0x20, 0x41, 0x6d, 0x20,
                             0x41, 0x20, 0x4c, 0x61, 0x7a,
                             0x79, 0x20, 0x43, 0x72, 0x65,
                             0x74, 0x69, 0x6e };
    private ArrayList printers = new ArrayList();
    private JButton jbDone = new JButton("Done");
    private JTextField jtfInput = new JTextField(20);
}

Similar Messages

  • Closing Console window while running Java application from Batch file

    Hi all,
    I have made a small application using Java swings,now i have made a jar file of my application and calling this jar file through batch file,when user clicks on that batch file it runs "java -jar applicationname.jar" command,but problem is that when i run that file from batch file it opens Dos console window at baclk of the screen which looks weird for a desktop application,i dnt want that Dos console window visible at the backend while my application is running,i have searched regarding this on google but found nothing usefull,if anybody can please help regarding that it will be a great releif for me,i have been stuck on this problem from last two days.
    Thanks.
    Simer

    warnerja wrote:
    georgemc wrote:
    warnerja wrote:
    start java -jar applicationname.jar
    That'll pop up another consoleI'm under the impression that the console window he is seeing is the one which cmd.exe opens when it is executing the batch file. And that batch file won't return until the java process has completed because he didn't start it in the background to let the batch file continue and terminate.
    So I don't think just simply substituting java with javaw will do much good either. Still think he needs a "start" command in that batch file.
    So now he can try:
    start java -jar ...
    or
    start javaw -jar ...Fair point

  • Run a script from batch file

    Hi All,
    I want to execute a SQL script that runs from a batch file.
    Lets say, I have loader.bat file. This .bat file connects to Oracle and wants
    to execute .sql file
    The content of loader.bat file is
    sqlplus
    @C:\temp_val_id.sqlAt run time it ask to userid and password. I enter the username and password and then get connect to Oracle
    But the temp_val_id.sql file is not exectuted.
    The output is as below, but .sql file is not executed
    C:\>sqlplus
    SQL*Plus: Release 11.2.0.1.0 Production on Wed Mar 28 17:19:50 2012
    Copyright (c) 1982, 2010, Oracle.  All rights reserved.
    Enter user-name: utest_tt_senayat/password@silver3
    Connected to:
    Oracle Database 10g Enterprise Edition Release 10.2.0.4.0 - 64bit Production
    With the Partitioning, OLAP, Data Mining and Real Application Testing options
    SQL>I am now trying a different method
    sqlplus
    @@C:\temp_val_id.sqlThe output is the same as above. Not executing temp_val_id.sql
    Could someone please assist me,
    Thanks in advance
    Saaz

    Saaz Ena wrote:
    sqlplus /nolog @test.sql
    content of test.sql:
    connect &user/&pass
    select sysdate from dual;
    exit;
    C:\work\test>sqlplus /nolog @test
    SQL*Plus: Release 11.2.0.1.0 Production on Wed Mar 28 16:21:12 2012
    Copyright (c) 1982, 2010, Oracle.  All rights reserved.
    Enter value for user: system
    Enter value for pass: manager
    Connected.
    SYSDATE
    28-MAR-12
    Disconnected from Oracle Database 10g Enterprise Edition Release 10.2.0.4.0 - 64bit Production
    With the Partitioning, OLAP, Data Mining and Real Application Testing options

  • Error running ODI scenario from batch file

    Hello, everyone!
    I am loading data into Essbase 11.1.2 from MS SQL Server views using ODI 11.1.1.5.0 and Local agent. I created an interface which runs ok if launched manually from ODI.
    Then I created the scenario named MyScenario for this interface and updated odiparams.bat file in *...\agent\bin* folder as follows:
    set SECU_DRIVER=weblogic.jdbc.sqlserver.SQLServerDriver
    set SECU_URL=jdbc:weblogic:sqlserver://<ServerName>:1433;databaseName=<DatabaseName>
    set SECU_USER=<UserName for Master Repository>
    set SECU_PASS=<encoded password for MasterRepository UserName>
    set ODI_USER=SUPERVISOR
    set ODI_PASS=<encoded password for SUPERVISOR>
    set WORK_REPOSITORY=<Work Repository name>
    Then I created the batch file in which I wrote: *...\agent\bin>startscen MyScenario 001 GLOBAL 5*
    However the scenario is not executed with the following error message:
    ERROR ODI-1132 Agent Internal encountered a warning: ODI-1414: Error connecting to agent Internal: a JDBC error occurs while connecting to the master repository. Caused by: org.springframework.jdbc.CannotGetJdbcConnectionException: Could not get JDBC Connection; nested exception is java.sql.SQLException: Exception occurred while getting connection: oracle.ucp.UniversalConnectionPoolException: Cannot get Connection from Datasource: java.sql.SQLRecoverableException: IO Error: The Network Adapter could not establish the connection
    I will be very grateful for any hints!

    A fundamental clarification : where is your master repository database located ? Is it on SQL Server as well ?
    The MS SQL Server connection that you mentioned in the SECU_DRIVER, SECU_URL should point to the MR database.
    Is the server name in SECU_URL a Fully Qualified domain name or just an IP Address reachable from localhost ?
    startscen will spawn a new instance of local agent.
    startcmd will reuse an existing agent (not local).
    Not sure why your local agent is getting a Network Connection Error.

  • Query regarding running Java application from Batch file

    Hi,
    I have written an application in Java and I have packaged it as a JAR file.
    In my system I use a batch file called 'run.bat' to execute the program. The batch file is as follows:
    java -classpath "%CLASSPATH%;editor.jar" editor.JPad
    This works fine in my system. But when it is executed in other systems where JRE is not configured properly, I am not able to correctly start the Java application.
    Please can anybody tell me, how to detect the JRE from the Batch file and refer to it correctly, so that it will run in any system with JRE.
    Can we do this from a Batch file ?
    Hoping for a quick reply.
    Thanks,
    S.Sampath

    You can't really "detect" whether a JRE is available from a batch. All I can think of is to check for the typical Java variables (JVM_HOME, CLASSPATH etc) to exist. If they don't, especially JVM_HOME, a JRE is probably not installed.

  • Run Message Analyzer From Batch File

    New to Message Analyzer trying to run it from a batch file but have not found any good examples. Can anyone please provide some help? Trying to use C:\Program Files\Microsoft Message Analyzer>messageanalyzer.exe /logmode  but it just opens the GUI
    I need it to run command line only and output to a file of my choice.
    Raymond McAuliffe

    PowerShell is the way we support automation with Message Analyzer. Check out this blog:
    http://blogs.technet.com/b/messageanalyzer/archive/2013/10/29/using-powershell-to-automate-tracing.aspx

  • Run sql statement from batch file

    How can we execute SQL Statement using Batch file???
    I did a test.
    create batch file test.bat
    sqlplus "username@db /pass" @\script.sql
    script.sql file has following statement
    select sysdate from dual;
    exit
    it is working but I want to call sql statement in the same batch file instead of calling .sql script file. how can I do that any idea..

    This is very easy in unix shell scripting, but AFAIK, not available with Windows. It's a function of how the shell/command processor handles input redirection.

  • Running the Java Code from Batch File

    Hi All,
    I have run a code sucessfully in Eclipse and it uses Logging API from Java
    When i try running the same program from batch file it throws error
    java.io.IOException: Couldn't get lock for log\Properties_Log_16Sep2009_150229
    at java.util.logging.FileHandler.openFiles(Unknown Source)
    at java.util.logging.FileHandler.<init>(Unknown Source)
    at com.adidas.SPM.LogMessage.<init>(LogMessage.java:26)
    at com.adidas.SPM.MainApplication.initialize(MainApplication.java:51)
    at com.adidas.SPM.MainApplication.main(MainApplication.java:102)
    I am working on a windows systems the folder log has all the permission i have provided with all
    Not sure why the code runs like this
    The batch file is like below
    set CURR_DIR=%CD%
    cd %CURR_DIR%\bin
    %CURR_DIR%\jre6\bin\java -classpath .;%CURR_DIR%\lib\FirstProject.jar com.test.MainApplication
    echo %ERRORLEVEL% The Error Level
    echo SUCCESS
    GOTO END
    :END
    pause
    Rgds
    Aditya

    Vikash.SunJava wrote:
    According to me the problem is that there are many instances trying to access the same property file. Nothing wrong with that since they only are reading it.
    The best way to do is that create a schedular in Windows that runs at some predefined interval (say 1 minute).Huh?
    >
    What will happen is if your program runs for more than a minute even then the new process will not start until old process is autaomatically killed. Please do not check this option if you want the program to exit normally.
    If the Task is still running stop at this time
    O_o

  • I want to run a report from the desktop

    I want to run a report from the desktop using RWRUN60
    What all has to be installed on it to make it work
    I have 10g client on mine and it works but I can't install that on all the clients
    Is there a little install package for this?
    Thanks

    RWRUN60 is a part of "Oracle From6i Developer Suit". If you want to run report on desktop client than you have to install "Form6i Developer Suit" on every client where report is needed.
    I was facing the same issue and it was a difficult job to install "Form6i Developer Suit" on each client. So, I done the followings.
    1. Configured Oracle Application Express
    2. Created Required Application in Oracle Application Express
    3. Installed "Oracle 10g Developer Suit" and configured "PDF Report Services"
    4. Now, each user is running the application through URL and I have saved my time of installations.

  • PLSQL WANTS TO RUN  WINDOWS PROGRAM FROM PLSQL PROCEDURE

    WANTS TO RUN WINDOWS PROGRAM FROM PLSQL PROCEDURE.
    I want to run EXE file from pl/sql program , i have tried host it does
    work in pl/sql .
    Is there any Solution to this problem
    Thank you

    Hi,
    It sounds like what you are trying to do, is run one mapping in a pre-mapping process of another mapping. You use a wrapper that implements sqlplus_exec_template.sql in PL/SQL. Is that correct?
    I don't think that by the way you execute this mapping, it ends up in the context of the process flow. The reason is because according to Warehouse Builder the mapping is being invoked standalone (through the wrapper that implements the template). As a result, the context in which Warehouse Builder would log the messages is lost.
    What I suggest you do (assuming I understand the problem correctly), is run the mapping as a separate mapping in the process flow. Because in the current release we do not support passing output parameters in the process flow, you will have to (temporarily) store the results of the first mapping in a table and pick it up from there in the other mapping. In the next major release (autumn 2004) we will support passing parameters between activities.
    Thanks,
    Mark.

  • Run a MS DOS batch file from the client

    Hi,
    I created a java source to run a bat file, the folder is loacted in the Database server.
    (Not in application server)
    create or replace and compile java source named execcommand as
    import java.io.*;
    import java.util.*;
    public class ExecCommand{
    public static void run(String cmdstr) throws IOException, InterruptedException
    try {
    int rtn;
    cmdstr = "cmd /c " + cmdstr;
    Process prcs = Runtime.getRuntime().exec(cmdstr);
    while (prcs.getInputStream().read() != -1 ) {}
    catch (IOException e) {
    e.printStackTrace();
    I called the java source from the procedure
    create or replace procedure run_batfile is
    begin
    execcommand(cmdtext => 'e:\services\genPDF.bat');
    dbms_output.put_line('file created successfully');
    exception
    when others then
    dbms_output.put_line(sqlcode || sqlerrm);
    end run_batfile;
    But the bat is not executing (The bat file is to generate a PDF file ). Bu when i executing this from my PC (Client PC) directly on the RUN , its generating the PDF file in the server.
    What could be the problem, What should be the path in the procedure,
    Shall i create any virtual directory ?
    Thanks in advance,
    Rizly

    Hi Justin ,
    Sorry for the late replay.
    I am running Oracle on Windows.
    The MS DOS Batch file is to convert XML file to PDF format. It is a Java Application.
    also it is a batch process, thats why i created a batch file for that. I am using FOP to convert XML to PDF.
    FOP is in the e:\services folder of the Database Server machiene. XML file is also in the same forlder and I need to generate the PDF file also in the same machiene.
    <<- You have a client machine. What do you mean by "executing this from my PC (Client PC) directly on the RUN , its generating the PDF file in the server.">>
    I have mapped the e:\services folder in my client machience, so i am accessible to the genPDF.bat file that is in the 'e:\services' folder of the DB Server. When i run the bat file from my PC as Start > Run e:\services\genPDF.bat . The PDF file has generated in the DB Server machien.
    I dont have the copy of the batch file in client machiene, but i have mapped to my client machiene.
    Thanks again,
    Rizly

  • Run import data in batch file

    Hi
    DOes anyone know how to run sqlplus and import command in a .bat file?
    I am trying to import about 10 database dump files into a database, what I want to do is to run sql statement to create tablespace/user in a .bat file first and then run import command to import the database dump files.
    I wrote the following scripts in batch file:
    sqlplus sm03/sm03@smdb1 @c:\table.sql
    where table.sql contain the sql to creat tablespace and user. THis part work fine when I tested it.
    But I don't know how to get back to commandline and continue to run the import command after sqlplus command finish. I hope just one click the bat file and it will run sqlplus command and import comand as well
    Any idea?
    Thanks
    Li
    THanks
    Li
    Message was edited by:
    user542038

    Hi Neil
    I know export/import have to be run from command line, what I am trying to do is run a batch file containing something like this:
    sqlplus sm03/sm03@smdb1 @c:\table.sql
    Import xxx/xxx@database name ......
    table.sql contain the sql to creat tablespace and user
    What I want or hope, if possible i am not sure, is that when I click this batch file, it will run the first line(sqlplus), and then after that, contiune to run the second line(import)
    The problem is after running the first line (sqlplus), it stil in sqlplus prompt. In order to run the second line(import), the script has to be exit sqlplus and back to command line. I try to add a $ after first line, it can get back to the command line, such as c:\>, but it won't execute the import command automatically unless I type the import command manually
    I am not sure if i miss something in batch file or it just can not do like that
    Thanks
    Li

  • How to hide sys and other passwords from batch files

    Hi all,
    I have my production database install on win 2003 server.The DB version is 9.2.0.4. There are some batch jobs are made to perform certain tasks like one job updates stats on daily basis run by user system,other job does online hot backups of all tablespaces as user sys.The scripts of these jobs are made on text file ,that contains user passwords.I want to hide those passwords from other people say system administrator etc who has access to production server.How can I hide these passwords.Any help from your side is appreciated.
    Best Regards,
    Majid.

    >
    I have my production database install on win 2003 server.The DB version is 9.2.0.4. There are some batch jobs are made to perform certain tasks like one job updates stats on daily basis run by user system,other job does online hot backups of all tablespaces as user sys.The scripts of these jobs are made on text file ,that contains user passwords.I want to hide those passwords from other people say system administrator etc who has access to production server.How can I hide these passwords.
    >
    If you have administrator rights on the win server, you could make use of OS authentication for sys and a user, you create externally and give him dba role. These users could then connect to the database after being logged on on the win server with
    SQL> connect / as sysdba
    SQL> connect /Look at
    http://download.oracle.com/docs/cd/E11882_01/network.112/e10574/authentication.htm#CHDBBFBF
    to see how to create an externally identified DB user.
    Kind regards
    Uwe
    http://uhesse.wordpress.com
    Edited by: Uwe Hesse on 22.01.2010 08:53

  • Compile and run java programs using batch file

    i am using eclipse to run my java programs.How to compile and run those programs using a batch file?

    a) just write a batch file, and add it to the project. When you want to run it, go to a command window and invoke it. (There is probably also a way to invoke it from Eclipse)
    b) if the project is complicated, take a look at ant. Eclispe knows about ant files.

  • Passing parameter values to powershell function from batch file

    Hello ,
       I haven't used powershell for a while and getting back to using it. I have a function and I want to figure out how to pass the parameter values to the function through batch file.
    function Check-FileExists($datafile)
    write-host "InputFileName : $datafile"
    $datafileExists = Test-Path $datafile
    if ($datafileExists)
    return 0
    else
    return -100
    <#
    $datafile = "C:\Dev\eMetric\PreIDWork\PreIDFiles\SampleInputFile_011.txt"
    $returncode = Check-FileExists -datafile $datafile
    Write-Host "ReturnCode : $returncode"
    $datafile = "C:\Dev\eMetric\PreIDWork\PreIDFiles\SampleInputFile_01.txt"
    $returncode = Check-FileExists -datafile $datafile
    Write-Host "ReturnCode : $returncode"
    #>
    The above code seems to be work when I call it. But when I try to call that script and try to pass the parameter values, I am doing something wrong but can't figure out what.
    powershell.exe -command " &{"C:\Dev\eMetric\PreIDWork\PowerShell\BulkLoad_Functions.ps1" $returncode = Check-FileExists -datafile "C:\Dev\eMetric\PreIDWork\PreIDFiles\SampleInputFile_01.txt"}"
    Write-Host "ReturnCode : $returncode"
    $file = "C:\Dev\eMetric\PreIDWork\PreIDFiles\SampleInputFile_01.txt"
    powershell.exe -file "C:\Dev\eMetric\PreIDWork\PowerShell\BulkLoad_Functions.ps1" $returncode = Check-FileExists -datafile $datafile
    Somehow the I can't get the datafile parameter value being passed to the function. Your help would be much appreciated.
    I90Runner

    I am not sure about calling a function in a script like how you want to. Also I see you are setting the values of the parameters, this is not needed unless you want default values if nothing is passed. The values for the parameters will be passed via the
    batch file. So for me the easiest way is as indicated.
    param
    [string]$DataFile
    function Check-FileExists($datafile)
    write-host "InputFileName : $datafile"
    $datafileExists = Test-Path $datafile
    if ($datafileExists)
    return 0
    else
    return -100
    Write-Host "Return Code: $(Check-FileExists $DataFile)"
    Then you create a batch file that has
    start powershell.exe
    -ExecutionPolicy
    RemoteSigned -Command
    "& {<PathToScript>\MyScript.ps1 -DataFile 'C:\Dev\eMetric\PreIDWork\PreIDFiles\SampleInputFile.txt'}"
    Double click the batch file, and it should open a powershell console, load your script and pass it the path specified, which then the script runs it and gives you your output
    If you find that my post has answered your question, please mark it as the answer. If you find my post to be helpful in anyway, please click vote as helpful.
    Don't Retire Technet

Maybe you are looking for