Calling DOS command from a webpage?
How would I go about doing this? I want a webpage that when an image is clicked this DOS command is called:
rundll32.exe C:\WINDOWS\System32\shimgvw.dll,ImageView_Fullscreen Image_Location\image.jpgThis command opens the image in Windows Picture and Fax Viewer. I'm not worried about portability since this is only going to be on my home network. I figure I'll probably need Java or something to do this, but I've no clue where to start looking. Help is appreciated!
How would I go about doing this? I want a webpage
that when an image is clicked this DOS command is
called:First of all, this is not a Java-related question. It is an HTML and browser capabilities question.
Second of all, in general this is not possible. If it were, imagine the security issues allowing a web page to arbitrarily allow executing anything on the client victim's machine. At best the user has to configure his browser to "trust" content from the site in question. Since you as the application provider can't force this configuration to happen automatically, you're out of luck unless you are in complete control over the clients (such as if they are all within the corporate intranet only).
Similar Messages
-
hi,
How can i call a DOS command from a WebDynpro Application. I tried this piece of code but it does not work.
Runtime.getRuntime().exec("cmd/c help");
Can somebody guide me with the same.
Thanks,Hi,
From Webdynpro its not possible until and unless its uploaded to the server.
Due to the following reasons
WD code runs in the server.
No client side scripting possible in WD.
Regards
Ayyapparaj -
How to call dos commands through HTMLDB buttons
HI,
How do i call DOS commands through HTMLDB buttons, or on any process?
can anyone help me on this?
THANKS!
BROKENThis article explains how to execute shell commands from whitin pl/sql using java (in the database).
http://www.oracle-base.com/articles/8i/ShellCommandsFromPLSQL.php
It is for Oracle8i but should still work. This still looks like a good way to go.
~Dietmar. -
Call Unix Command From Reports Using Java
Hi,
Could somebody please show me a sample coding to call Unix command from 10g report using java?
In metalink doc id 361857.1 does not show much.
Thanks,
neeminHi,
I have a problem with synchronization of the java commands.
In the Before Parammeter Form trigger, I have:
function BeforePForm return boolean is
rt ORA_JAVA.JOBJECT;
proc ORA_JAVA.JOBJECT;
v_txt varchar2(32000);
i integer := 0;
v_cd_modulo int;
v_arqlog text_io.file_type;
cursor c_evento is
select codigo,
nome
from
(select e.cd_evento || e.cd_edicao codigo
,nm_evento nome
from grh_ev_evento e
where e.CD_GRUPO in (select cd_grupo
from grh_ev_adm
where cd_usuario = (select cd_usuario
from usuario
where login_usuario = :AUTHID)))
order by substr(nome, 11);
begin
-- Create the context for logged user
if instr(upper(nvl(:AUTHID,'RWCLIENT')),'RWCLIENT') > 0 then
:AUTHID := :SSO_USUARIO;
end if ;
TCEENV.SET_TCEENV(:AUTHID);
if PK_SCA.SCA_GET_USER_RIGHTS(:sca_module_name, :AUTHID) IS NULL then
srw.message(100, 'Access denided!');
return (FALSE);
end if;
-- Create file in Report Server (UNIX)
v_txt := '<BR>' || htf.formSelectOpen('P_EV_EDICAO', 'Evento: ');
:p_file := '/u03/SCAWEB/repout/' || :sca_module_name || '_' ||
pk_sca.sca_encrypt(:AUTHID || to_char(systimestamp, 'ss.ff'));
v_arqlog := text_io.fopen (:p_file, 'A');
text_io.put_line (v_arqlog, v_txt);
for reg in c_evento loop
i := i + 1;
if i = 1 then
v_txt := '<OPTION SELECTED VALUE="' || reg.codigo || '">' || reg.nome;
else
v_txt := '<OPTION VALUE="' || reg.codigo || '">' || reg.nome;
end if;
text_io.put_line (v_arqlog, v_txt);
end loop;
v_txt := '</SELECT></CENTER></form></BODY> </HTML>';
text_io.put_line (v_arqlog, v_txt);
text_io.fclose (v_arqlog);
SRW.SET_AFTER_FORM_HTML(SRW.FILE_ESCAPE, :p_file);
rt := RUNTIME.GetRuntime();
proc := RUNTIME.exec(rt,'rm ' || :p_file);
return (TRUE);
end;
The problem is that there isn't a "synchronize" command, and the
RUNTIME.exec(rt,'rm ' || :p_file) don't works (it does nothing) because
the SRW.SET_AFTER_FORM_HTML has a large delay and the following
command is ignored.
How can I solve it?
thanks,
lmprestes -
hi all
how do i run dos commands from java??????????Using Runtime#exec().
Also see http://java.sun.com/j2se/1.5.0/docs/api/java/lang/Runtime.html -
Hi, I need to perform a DOS command from Java (using WFC if needed)...
I have no idea, so please help!
Thank you.OH OH OH WAIT! It is an Applet! i think there will be some security issues here! Sure enough you can't execute commands on the system from an applet unless you make some changes on the java.policy files on the client machine (that means, if your applet is in a web page, every machine which view your page).
-
hi experts ,
i need to execute DOS command from SAP .
earlier we have 'GUI_EXEC' WS_EXECUTE , 'WS_DOWNLOAD' etc which are Obsolete now.
as we are using ECC6.0. kindly guide how to do this.
best regards,
RahulTry out...
DSVAS_DOC_WS_EXECUTE_50
or
CL_GUI_FRONTEND_SERVICES=>EXECUTE
<b><REMOVED BY MODERATOR></b>
Thanks & Regards
ilesh 24x7
Message was edited by:
Alvaro Tejada Galindo -
How to call gnuplot command from java
Hi there,
In our course, we are required to develop an GUI for gnuplot. In case you don't know about gnuplot, it's a plotting program and has lots of command. We want to use java and swing, but now we don't know how to call gnuplot command from java, or how to execute a shell command(script) from java.
By the way, since we need read in files with several columns of data and allow user to select a column, we want to use JTable. Is that reasonable?
Thanks a lot for any suggestions!
JackHi, there:
Will using JTable add much overhead? I may have to use several JTables and switch among them. I can add scroll bar to or edit JTables, right?
BTW, do you have experience about gnuplot? Can I find the command tree of gnuplot somewhere? Or do you know a better place to post question about gnuplot? unix/linux group, maybe.
Thanks,
Jack
P.S. Would you guys answer my question after I use up my duke dollars? :- ) -
How to run a DOS command from an Oracle form.
How can I run a DOS command from an Oracle form (i.e. open the calculator located at c:\windows\system32\calc.exe)?
first of all get the environment variable for the c:\windows\system32 direcotry for any of the windows
you can use get variable from the ora env package
now cancat the system32 variable with the calc.exe string
now pass the string with host command as parameters
this process will work for all type of windows. -
Can we execute DOS Commands from a Java Application
I just want to know whether we can execute DOS Commands from a Java Application.
Thanks.hi,
try this:
Runtime.getRuntime().exec("cmd /c start abc.bat");
andi -
Executing a DOS Command from JSP
How do i execute a Dos command from within JSP. I would like to execute a sql Loader command .
ThanksYou use Runtime.execute().
Take a look here for a few of the tricks involved in it:
http://www.javaworld.com/javaworld/jw-12-2000/jw-1229-traps.html -
How to run multiple DOS commands from a single Webutil Client_Host session?
Hello all,
I have a requirement where I need to create an interface with SVN from Forms for basic checkin-checkout of files.
So, I've been trying to use webutil client_host to open a command line session and issue svn commands.
For svn, sometimes I need to give multiple commands like change to a particular directory and then run an svn command.
But client_host takes in only one command at a time and I'm unable to issue a series of DOS commands to perform
a particular task.
Is there a way to do this?
Pls suggest.
Regards,
SamFirst your original question... You can put more than one DOS command on a single line, simply separate each command with an ampersand (&). For example:
mkdir c:\abc & cd abc & dir*
Regarding your concerns about performance, well that would depend on exactly what you mean. Using CLIENT_HOST (or HOST on the server) simply opens a shell (DOS in this case) then passes your command to it. The performance of performing this action really isn't measurable. Basically you are just pressing a button and you should get a near immediate action. As for the performance of executing each command, that has nothing to do with Forms. Once the command is passed to the shell, the rest is a function of the shell and whatever command you passed.
Having said that, if you were to write something sloppy like a loop (in pl/sql) which called CLIENT_HOST lots of times repeatedly, then yes there would be a performance problem because the pushing of the button will cause an exchange to and from the server and each cycle in the loop will do the same.
So the answer to how performance is impacted will depend on what exactly you need to accomplish. If it is a single call to CLIENT_HOST, this should be fine. -
Use several DOS command from java program
Using "Runtime.getRuntime().exec(toto.bat)" I have no problem to run a Command in my DOS window...
But the problem appear when I want to call another command in this same window from myApp.java...
In fact after executing the first command I find no way to have another access to this DOS window...
Is there any way to set the Process created by calling exec() method as the default system??
Hope my explications are clear...
Does someone have the solutions...this will help me so much...
bilbou.ok but I have found no forum which resolve my problem...can you give more details about what you think concerning the solution of my pb...
bilbou. -
Error using DOS Command from Java
Hi,
I am using the following code to execute the DOS command to delete a file from Java.
cmd = "del " + fileName;
Runtime run = Runtime.getRuntime();
Process proc = run.exec(cmd);
Getting the following exception during runt time.
Exception = java.io.IOException: CreateProcess: del D:\LAWDOCS\P50074\12\3\36857.3 error=2 --
Can some body throw light on this?.
Thanks,
Jeyaraman R"del" is not an actual executable file, but instead a command in the command interpreter. So you can't just execute del like that, you have to run the command interpreter and tell it to execute the del command.
If you are on windows NT, 2000 or XP, replace your command with "cmd /C del " + filename.
If you are on Windows 95, 98 or ME, use "command /C del " + filename. (I am not quite sure if the switch for this is called /C on old windows version.)
(But why not use File.delete()?) -
How Can I call a OS Command from database stored procedure. From Developer I use host command.
ThanksYou can use java stored procedures for this purpose if you are using Oracle8i.
Here is some sample code for doing this.
import java.io.*;
import java.util.*;
public class ExecDemo {
static public String[] runCommand(String cmd)
throws IOException {
// set up list to capture command output lines
ArrayList list = new ArrayList();
// start command running
Process proc = Runtime.getRuntime().exec(cmd);
// get command's output stream and
// put a buffered reader input stream on it
InputStream istr = proc.getInputStream();
BufferedReader br =
new BufferedReader(new InputStreamReader(istr));
// read output lines from command
String str;
while ((str = br.readLine()) != null)
list.add(str);
// wait for command to terminate
try {
proc.waitFor();
catch (InterruptedException e) {
System.err.println("process was interrupted");
// check its exit value
if (proc.exitValue() != 0)
System.err.println("exit value was non-zero");
// close stream
br.close();
// return list of strings to caller
return (String[])list.toArray(new String[0]);
public static void main(String args[]) throws IOException {
try {
// run a command
String outlist[] = runCommand("/bin/ls -l");
//String outlist[] = runCommand("/u02/home/usupport/ashehade/java/test");
// uncomment this line an comment above if you want to execut
// a c executable called test.
// display its output
for (int i = 0; i < outlist.length; i++)
System.out.println(outlist);
catch (IOException e) {
System.err.println(e);
Load this to the datbase
loadjav -u scott/tiger ExecDemo.java
Publish the proceduer
create or replace procedure lsfromjava as
language java name 'ExecDemo.main(java.lang.String[])';
Test it
SQL> set serverout on
SQL call dbms_java.set_output(2000);
SQL> execute lsfromjava
total 1770
-rw-r--r-- 1 usupport udba 8385 Aug 27 1999 init.ora
-rwxr-xr-x 1 usupport udba 1724 Mar 14 05:46 initCONV.ora
lrwxrwxrwx 1 usupport udba 45 Mar 10 11:01 initMWS2.ora ->
/u03/app/oracle/admin/MWS2/pfile/initMWS2.ora
lrwxrwxrwx 1 usupport udba 59 Jan 11 16:09 initV816.ora ->
/u02/app/oracle/product/8.1.6/admin/V816/pfile/initV816.ora
-rw-r--r-- 1 usupport udba 9219 Aug 27 1999 initdw.ora
lrwxrwxrwx 1 usupport udba 59 Feb 14 11:55 initreid.ora ->
/u02/app/oracle/product/8.1.6/admin/reid/pfile/initreid.ora
-rw-r--r-- 1 usupport udba 835 Nov 3 17:07 initsoxx.sql
-rw-rw---- 1 usupport udba 24 Mar 13 10:22 lkBLEVE
-rw-rw---- 1 usupport udba 24 Mar 14 05:46 lkCONV
-rw-rw---- 1 usupport udba 24 Mar 13 04:48 lkMWS2
If you are using Oracle 8.0.5 , then you can use external procedures for this.
There was one article in the Oracle Magazine for doing this with external procedures. You can search the archives for this purpose.
Maybe you are looking for
-
Copy and Paste of Images NOT working.
When I right click on an image and choose 'copy image' and then try to paste it into my editing software, all i get is a string of text that is the location of the image as if I had chosen 'copy image location' instead. what gives?
-
How to compare a boolean value returned from a function in a sql query
Hi all i have a function which return boolean true or false. mean while i am writing a sql query which should check this function and will return a result set only when it is true. how will i use a function which returns boolean in a sql query.. than
-
SYHR_A_P0105_AF_SYSUNAME isn't filled in Ad hoc query
Hello, We'd have EhP7 now. We have a problem that in the Ad hoc queries, the standard fields like SYHR_A_P0105_AF_SYSUNAME which shows the user name isn't populated. The same applies to private e-mail, work e-mail, etc. I know that I could select in
-
I lost a tracking # for a package. The # appears on a previously printed document. Can I retrieve that document from a log? If so how?
-
How to the variable from the other program
Hi sap guys, Consider there are two programs. That is Program A and Program B. Now i want to use one variable in program A from program B. How to do this? Please Help Me on This Thanks Basu