How to run exe file from inside java
I wan to run an exe file from inside java code. How can I do it?
Thanks
Hi Oakam
This is very simple. Just go through the given code below
in place of FILEANDPATHNAME just give the exe's path and name
Note :- adding ".exe " is not necessary
public class exep
public static void main(String args[])
Runtime r = Runtime.getRuntime();
Process p = null;
try{
p = r.exec("FILEANDPATHNAME");
catch(Exception e)
Give ur feedback
Thanx
Ottran
Similar Messages
-
How to Run Batch files from inside Reports.
Hi All,
I have 2 questions.
1) How to change the direction of the reports with Arabic orientation i.e Right to left Change without changing the registry.
2) How to execute a batch file from report or before execution of the report i.e before opening the report.
I want to set few environmental variables before opening the report. How do i achieve this?
Request the forum community to discuss and help me out on this issue.
Thanks in advanceThanks Inol
Though my report is running NLS variable values given in the batch file is not getting picked.
Here is my batch file contents. My NLS Variables are not getting picked in the reports. I want that to be picked up and the reports orientation should change automatically as per the NLS variables given in the batch file.
Please go through my batch file code.
set NLS_LANG = AMERICAN_AMERICA.UTF8
set NLS_CALENDAR = GREGORIAN
set NLS_DATE_FORMAT = dd/MON/yyyy
set FORMS60_PATH = <Enter Relevant Path>
set REPORTS60_PATH = <Enter Relevant Path>
set PATH=%PATH%;c:\forms6i\bin
set ORACLE_HOME = c:\forms6i
set TNS_ADMIN = c:\forms6i\NET80\ADMIN\TNSNAMES.ORA
rwrun60.exe d:\DOTNETORION17_bin\elist_rg1.rdf userid=scott/tiger@thai P1=10Please help me out in getting this value picked and run the report. -
How to run .EXE files from Linux Portal page?
We have an IIS web server that runs a Photoshow_player.exe slide show program. I'm not sure if this can run from Linux Portal, but we are trying.
The link in an IIS web page looks like this:
<a> href="file:///\\mulsrv22\share\PCS\PhotoshowPlayer.exe" title="clean slate">clean slate</a>
Portal is installed and running from two Linux servers. If I create a link using the above syntax, I get "can not display page" browser errors.
I copied the entire PCS directory from the Windoz box to a Portal web_dav folder, but running the .EXE link from that Portal page gives errors indicating that the /PDS/data/.XML and /PCS/data/.jpg files can not be found.
Any ideas on how I can run this slide show from Linux Portal?
Thanks.
--Donif you just need to run a slideshow in you portal, why don't you use a javascript slide show ?
Just "googleize" and you'll find tons of javascripts taht can do that.
for example : http://www.barelyfitz.com/projects/slideshow/ -
How to run .exe files with Virtual PC for Mac
Hey Guys, I'm new around here and with mac technology as well. Anyway, I have an iMac OS X 10.5.1 Leopard and I've recently purchased the Virtual PC for Mac 7.0.2 software. So I'd like to know how to use this program properly, because I need to run some executable files in my computer. It is confusing for me because I don't know how to get started, and I only get to the part when it says "OS not found, Install an OS on this hard drive".
Honestly I've no idea of what an OS is or where do I get that. So I'd really appreciate if one of you guys could tell me, step by step, what to do to use Virtual PC properly, and finally learn how to run .exe files on mac.
Thanks in advance!
Have a nice day!Always nice to see new faces
Honestly I've no idea of what an OS is or where do I get that.
This brings up the second part of your problem. The first part is setting up either a proper Virtual Machine program like Parallels or VMfusion, or setting up a Boot Camp partition on your drive.
http://www.parallels.com/
http://www.vmware.com/products/fusion/
OS stands for Operating System. You are running Leopard 10.5.7 as an operating system on your Mac (MacOS X).
The second part of your problem - You will need a copy of Windows XP or Vista if you want to run Windows on your Mac.
There is at least one other solution for running Windows programs on a Mac. It's called "CrossOver" by a company named 'Codeweavers'. It's based on a project for "Wine" to be able to run PC programs on a Mac or Linux, without having to buy or install Windows. It works with a narrow subset of Windows programs so you would want to make sure the program you want to run is compatible with CrossOver before you buy it.
http://www.codeweavers.com/products/cxmac/
In addition to all the above information, you need to upgrade your Mac to the latest 10.5.7 from 10.5.1. "Software Update" is located under the black Apple icon in the Menu Bar at the top left corner of your monitor. After you are updated you will want to update your Profile here so that it shows the proper OS version.
With your level of experience with MacOS X and the Windows OS's you should probably get some help from a local Apple store. They have an appointment system and do offer many types of help and training, and they can offer assistance with choosing the proper programs for you to purchase for your machine.
You are also welcome to continue to ask questions here, of course. You will want to ask your questions with different issues that come up in different threads so that the answers stay focused on the title of the thread.
Message was edited by: dechamp to try to be more accurate with a fairly complicated issue... -
How to run .exe files in mac pro?
how to run .exe files in mac pro?
i am looking for this to play games in my mac pro.
if someone got a answer, just let me know
cheers.mailking wrote:
And I fail to see why you are attacking me...
My comment is Valid... " .exe files will not run natively on Mac OS X..."
I am sorry. I had the false impression that it was commonly known that .exe files did not run on Mac OSX natively and failed to see any constructive critique you were bringing. Maybe I am wrong. Again deepest apologies.
Unfortunately... these days... not every one is aware of this .exe fact..
Apology accepted.. and Thank You.. -
How to run batch file from oracle forms 9i
Hi everyone.
i have a data in csv file. i want to upload it to my database. i am using sql loader for it.
i have made a batch file which run the sql loader and transfer my data to database.
How to run batch file from oracle forms 9i.
when i press the button, nothing uploads in my database. (when i simply run the batch file it works).
here is my code
Begin
HOST('C:\temp\batchfile.bat');
message('done');
end;
Thanks in advance
regards
sajidthis is my log file, when i run manually.
SQL*Loader: Release 10.2.0.1.0 - Production on Thu Jul 1 23:27:53 2010
Copyright (c) 1982, 2005, Oracle. All rights reserved.
Control File: file_to_upload.ctl
There are 2 data files:
Data File: sk.csv
Bad File: sk.bad
Discard File: none specified
(Allow all discards)
Data File: sk1.csv
Bad File: sk1.bad
Discard File: none specified
(Allow all discards)
Number to load: ALL
Number to skip: 0
Errors allowed: 50
Bind array: 64 rows, maximum of 256000 bytes
Continuation: none specified
Path used: Conventional
Table KHAN, loaded from every logical record.
Insert option in effect for this table: APPEND
Column Name Position Len Term Encl Datatype
SR FIRST * , O(") CHARACTER
DATES NEXT * , O(") CHARACTER
AGENT NEXT * , O(") CHARACTER
COUNTRY NEXT * , O(") CHARACTER
TRANSACTIONS NEXT * , O(") CHARACTER
PKR NEXT * , O(") CHARACTER
USD NEXT * , O(") CHARACTER
BANK NEXT * , O(") CHARACTER
Table KHAN:
11088 Rows successfully loaded.
0 Rows not loaded due to data errors.
0 Rows not loaded because all WHEN clauses were failed.
0 Rows not loaded because all fields were null.
Space allocated for bind array: 132096 bytes(64 rows)
Read buffer bytes: 1048576
Total logical records skipped: 0
Total logical records read: 11088
Total logical records rejected: 0
Total logical records discarded: 0
Run began on Thu Jul 01 23:27:53 2010
Run ended on Thu Jul 01 23:27:54 2010
Elapsed time was: 00:00:00.63
CPU time was: 00:00:00.17 -
How to run .html file from .java file..?
Hi All,
I was just trying as mentioned in the subject of how to run an html file from a java file.We have runtime class which inturn is having exec method which returns process but it supports only .exe as an argument .Is there any way to do this???
Thanks in advance.viswa07 wrote:
You mean to say Desktop class in java...???I'm so sorry, I thought you knew enough Java to look up the API.
[This link|http://java.sun.com/docs/books/tutorial/getStarted/cupojava/index.html] might be more at your level.
db -
Running exe files from java applications
Hello All,
Is it possible to run executable files from java applications?
I need to run an exe file on the client from the server machine, the exe could reside on either the server or any other machine on the LAN. Is it possible to specify the path of where the exe resides, and run it on a client machine?HI,
I tried to launch a MS Word application using runtime.exec but it gives me some problem
The foll. code to launch a txt file using notepad works.
Runtime rt = Runtime.getRuntime();
String[] callAndArgs = {"notepad.exe","C:\\coo7\\wizard.txt"};
Process child = rt.exec(callAndArgs);
However, oif I try to launch a MS Word application, it asks for the entire path of WINWORD.exe, (unlike just specifying notepad.exe as the first argument in String[] callAndArgs) and this can vary from one machine to another.. how do I get around this?
The foll. code snippet works but the complete path of where WINWORD.exe might be installed on any machine, is not fixed:-(
Runtime rt = Runtime.getRuntime();
String[] callAndArgs = {"C:\\Program Files\\Office\\Office10\\WINWORD.exe","C:\\coo7\\wizard.doc"};
Process child = rt.exec(callAndArgs);
Any idea/suggestions pls.. -
How to run SQL files from Java?
Hi,
Can someone point me towards a link on how to run sql files in Java? Thanks.
P.S...if I've been completely blind please go easy on me!Sorry forgot the formating code thingy
public static boolean executeScript(File script, Connection conn){
boolean success = true;
success = script.exists();
if(success){
DEBUG.print("ES::READING SCRIPT:" + script.getAbsolutePath());
StringBuffer buffer = new StringBuffer();
success=readScript(script,buffer);
if(success){
try{
String creationScript = buffer.toString();
Statement st = conn.createStatement();
int start = 0;
int end = 0;
while (end != -1 && start < creationScript.length()) {
end = creationScript.indexOf("GO", start);
if (end != -1) {
DEBUG.print(creationScript.substring(start, end));
st.executeUpdate(creationScript.substring(start, end));
start = end + 2; //2 is the length of "GO"
st.close();
}catch(Exception e){
success=false;
DEBUG.printStackTrace(e);
}else{
DEBUG.print("ES::SCRIPT FILE DOES NOT EXISTS");
success=false;
return success;
public static boolean readScript(File script, StringBuffer buffer){
boolean success = true;
DEBUG.print("RS:: reading file :" + script.getAbsolutePath());
try{
InputStreamReader isr = new InputStreamReader(new FileInputStream(script),"UTF16");
int ch;
while ( (ch = isr.read()) > -1) {
buffer.append( (char) ch);
if (isr != null)
isr.close();
}catch(Exception e){
success=false;
DEBUG.printStackTrace(e);
return success;
} -
How to run exe files using peoplecode?
How to run .exe extension files using peoplecode. It should execute on clicking a button.can anyone provide sample peoplecode for the same.
where do i place the exe files ? Local workstation or Server or FTP?
can i use the same peoplecode if i'm using a button on grid.1. You can use function Exec in PeopleCode to run any exe file
2. You can use ViewContentURL function in PeopleCode to view any .pdf or .doc documents
Jayaprakash Tedla -
hi all
i am looking for code to run a program(any EXE File ) from developer Form (Developer 6i)
thanks a lotlook at the documentation for the HOST command in Forms.
Regards
Grant Ronald
Forms Product Management -
How to run .exe files on macbook pro
Just bought my first macbook pro the other day. I absolutely love it. Much better than the windows boxes. I wanted to run some '.exe' files on my new laptop but was not successful finding anything on the market to use without purchasing a full OS version of Windows. Is there any software out there that I can use to run '.exe' files without purchasing a full Windows OS to do so. I know about parallels for MAC but that seems to require purchasing Windows OS? Any help is greatly appreciately.
Here are the specs on my Macbook Pro.
2.2GHz quad core i7
4GB RAM
500GB HDDSome Windows software -- not all, by a long shot -- will run on a Mac without installing Windows, with the aid of the CrossOver Mac emulator:
http://www.codeweavers.com/products/cxmac/
Games generally won't. For those, you need Windows installed through Boot Camp so you can run Windows natively. -
How to run .exe files with DAQ on a target PC?
Hi,
I want to run LabVIEW executable files on a target PC, where there is no LabVIEW installed. These files are used to do measurement using DAQ devices.
In order to run these .exe file, I guess that I should install both LabVIEW Runtime Engine and NI-DAQmx on the target PC. Is it right?
I'm wondering if it is mantatory to install NI-DAQmx on the target PC. I tried running .exe files without NI-DAQmx installed, but there was an error: nilvaiu.dll couldn't be found. Shouldn't this file be included automatically when building the executable files?
Thanks,
QifuNo, none of the hardware drivers are included in the LabVIEW exe that you build. You have to install DAQmx. With LabVIEW 8.x, you can include the DAQmx driver with the installer that you create. You also have the option to install different versions of DAQmx. These different versions are smaller than the full DAQmx install (i.e. you may choose to install documentation, MAX. etc.). When you create the installer, you also inclue the LabVIEW run-time and you should also choose to install the hardware configureation that is in MAX.
-
Hi all,
Can anybody give me proper way to run exe file in
coldfusion. I have tried with cfexecute tag but it is not
working...
Thanks,
Manojtclaremont wrote:
> Are you trying to run an executable on the server, or on
the client machine?
> Does the CF service have execute permissions on the
directory in question? What
> does your error log say with regard to the attempted
execution?
>
To add to all these valuable questions, what executable are
you trying
to run, what kind of parameters does it need? It can be a bit
tricky to
pass complex parameters through the <cfexecute ...>
tag. -
How do I run an exe file from a java program?
I need to run an exe program from within a java program.
what do I need to do this?
thanksSee java.lang.Runtime.exec()
Maybe you are looking for
-
I tried installing XP with SP 2 and I guess I pushed the wrong button because I got an error screen that said something like "Press any key to boot from CD. Disk Error. Press any key to restart." I saw a troubleshoot topic that had this exact error,
-
Reinstalled Windows - how to restore iTunes from backup?
OK, here's the short succinct and none-waffley version of my question: Under OSX there's a whopping big (xml?) file stored in the iTunes Library folder, but where is that on Windows? I've read about a Library.itl file, is that the same thing? If so,
-
Exaprom PDF: how may cells span multiple rows in the table body?
I'm using Exaprom PDF but I have a case I just can't get to work. I would like to generate a table where a cell spans on an entire row in the table body, the table should result as: |__|__|__|__| |__|__|__|__| |___________| |__|__|__|__| Dear Jean-Ma
-
Problem install Nokia DKU-5 connectivity in Win XP...
I have reinstall my windows in Win XP Sp3 and Win 7 ultimate Sp1, then I install all driver and DKU-5 from CD, but when I plug my DKU-5 cable into USB, Windows XP SP3 and Windows 7 detect my cable as TUSB3410 Boot Device. I have tried to search autom
-
Loading applet..
Hello I've an applet in a *.jar file with the classes, some images, etc... This applet take a little time to load in the explorer, so i'm sarching fomr something to read, or some code, i don't know.. to make an 'loader applet'.. to print a message 'L