Latest Tutorials| Questions and Answers|Ask Questions?|Site Map



Home Answers Viewqa Java-Beginners Trouble in running Dos Command from Java Servlet

Have Programming Question? Ask it here!
 
 
 


Sid
Trouble in running Dos Command from Java Servlet
0 Answer(s)      2 years and 4 months ago
Posted in : Java Beginners


Hello All, I have to run following command from Java. The command is : vscanwin32 /S C:\Test > C:Scan_Result.txt

vscanwin32 is resided at location: C:\Program Files\Trend Micro\OfficeScan Client

I have tried this : String dosCommand = "C:\Program Files\Trend Micro\OfficeScan Client "; String dosCommand2 = "vscanwin32 /S C:\FileListing"; Runtime.getRuntime().exec("cmd /c dir");

I gets error as: java.io.IOException: Cannot run program "C:\Program": CreateProcess error=2, The system cannnot find the specified file.

The above line of codes are in one servlet and from servlet I wants to run specified DOS Command. Can anyone help me out here ? I have tried googling too. But the googling results are very limited to commands like 'cmd /c dir /s'.

Looking forward for the help.

-Java Beginner


Advertisement
View Answers

Related Tutorials/Questions & Answers:
Trouble in running Dos Command from Java Servlet
Trouble in running Dos Command from Java Servlet  Hello All, I have to run following command from Java. The command is : vscanwin32 /S C:\Test > C... servlet I wants to run specified DOS Command. Can anyone help me out here ? I
Compiling and Running Java program from command line
Compiling and Running Java program from command line - Video tutorial... of compiling and running java program from command line. We have also video... the process of compiling and running the Java program from command prompt
Advertisements
Java tree map trouble
Java tree map trouble  This is a project for a class, and I am totally stuck! I've created a tree map using an input text file. I split the lines into fields so that I could work with 2 elements from the file. It appears
Java memory options from command line
Java memory options from command line  Hi, How to use java memory options from command line? Thanks   Hi, Here is the example code: java -Xms1056m -Xmx1056m MyProgram Thanks
How to clear Dos screen in java? - Java Beginners
How to clear Dos screen in java?  How to clear Dos screen in java? Is there any way to clear the dos screen in windows platform just like "cls... having the DOS command like "clr". Now you can call that particular batch file
How to clear dos screen just like cls in dos - Java Beginners
How to clear dos screen just like cls in dos  You said we have to write bat bile. so every time i have to call that file in my java program am i... answer  Hi Friend, Put the 'cls' command in your batch file(ab.bat) and call
How to clear Dos screen in java? - Java Beginners
How to clear Dos screen in java?  How to clear Dos screen in java? Is there any way to clear the dos screen in windows platform just like "cls" in dos and clrscr in c
how to clear dos screen in java - Java Beginners
how to clear dos screen in java   how to clear dos screen in java
How to clear a Dos Window? - Java Beginners
How to clear a Dos Window?  problem with the following code: This code is opening another dos window.Is it possible to close the first dos window without exiting from the second window...I don't want to open two windows...how
Java I/O From the Command Line
Java I/O From the Command Line In this section we will learn about the I/O from the command line in Java. Several times you can see that the programs runs after taking the input from the command line. Java also supports for the command
Summary: DOS Commands
and executing Java programs from DOS prompt. Before Windows, there was the ugly... utilities that can be run from the DOS command line. APPLETVIEWER fRuns...Java Summary: DOS Commands In this section we will discuss about DOS commands
How To Read String From Command Line In Java
How To Read String From Command Line In Java In this section we will discuss about how string can be read through the command line. In Java command line... giving from the command line. Command line arguments are passed
ping command in servlet
ping command in servlet  hi can we execute ping command in servlet like as we do in normal java. if we can please give an example how. thanks & regards
problem running a servlet on tomcat.
problem running a servlet on tomcat.  i have followed the steps given... suppose that should mean that my tomcat server is up and running. but whn i try to run my servlet that is placed in the directories as it has been mentioned here
Command line argument in java
Command line argument in java. In this section we are going to discuss about command line argument in java. Command line argument allow a user to pass arguments at the time of running the application , after the class name. Java allow
java program for Denial of Service (DoS) attacks detection - Swing AWT
java program for Denial of Service (DoS) attacks detection  i want a simple program to generate and detect a Denial of Service (DoS) attacks. using java program
running java with classpath in cygwin
running java with classpath in cygwin  The following command works in cmd.exe but failts in cygwin shell. java -cp .;oracle.jar;mysql.jar Executecmd query value; how should i alter the command to run in the bash shell?thanks
iperf command in java
iperf command in java  How to write a code for iperf command in java
Java Command Line Input
Java Command Line Input  How to get input from command line in java ?   Hi please Find the code for inputting data from the command line System.out.println("Please Input A Number"); BufferedReader br
How to run PHP Script from the command line ?
How to run PHP Script from the command line ?  Running PHP Script from the command line   Actually it is very simple to run php script... expect. You can also check : http://www.phpzag.com/running-php-script-from
Command Line Arguments in Java Program
directly from the command line. The user can enter command-line arguments when invoking the application. When running the java program from java command... Command Line Arguments in Java Program   
i want to copy files from one machine to other using java and the code will be running on third machine
i want to copy files from one machine to other using java and the code will be running on third machine  i want to copy some files from one machine say 'A' to some other machine say 'B' by using the java program running on third
execute dos commands
execute dos commands  how to execute dos commands using a java program
Running Java Applications as software
Running Java Applications as software   Please tell me what to do if you want your java application to run like a real software,eg a java GUI application that connects to the database(Mysql)running on the computer like any other
Running threads in servlet only once - JSP-Servlet
Running threads in servlet only once  Hi All, I am developing a project with multiple threads which will run to check database continuously... process while mail thread is running. these two separate threads has to run
Repairing mysql database from command line
Repairing mysql database from command line  Hi, Can anyone tell me the process for repairing mysql database from command line? Thanks
Running core java program
Running core java program  I am jayesh raval. I am going to make simplae program and at the time of runnint that program I found class not found exception. I have clear source of that program and that is right in the syntax. so
How to invoke method of a library from command line
How to invoke method of a library from command line  Suppose there are two methods in a libray and you have to invoke one of the method from that library directly from the command prompt. How will you do
run command prompt from jsp program
run command prompt from jsp program  Hi.... Is it possible to run a command prompt from jsp? If possible please help me with some code... Thanks & Regards vanchinathan.R
Java Not running - Java Beginners
Java Not running  Hi, I tried to create a grade(type array) and final_grade (type of String) program using getter/setter but not want a public setter method for final_grade; Here is my program that calcuate the average of all
Servlet os running commands issues - Development process
Servlet os running commands issues  hello, i want the help regarding the running os commands through servlet. so please send it either on my personal email address or send it on the rose india servlet tutorial. thanx n
What is command line argument in Java
example of command line argument program in Java?? It will be really helpful... of arguments from the command line. Arguments are passed as a string array...What is command line argument in Java  What is command line argument
How to Get currently running processes in a tabular form in java
me a static table as the cmds contains a dos command tasklist. thank you...How to Get currently running processes in a tabular form in java  I need to create a frame that shows all the current running processes in the system
process of compiling and running java program
process of compiling and running java program  Explain the process of compiling and running java program. Also Explain type casting
How To Read Integer From Command Line In Java
How To Read Integer From Command Line In Java In this section we will discuss about how an integer can be read through the command line. In Java all... value from the command line. In this example I have created a class named
Command Line Arguments in Java
Command Line Arguments in Java The ongoing Java application can accept any number of arguments from the command line but it is command line argument, which...-line argument is an argument, which passed at the time of running of the Java
Running Batch files in java - Java Beginners
and every line from the batch file and execute it line by line in java. Is anyone... are sending you some sample program code for running batch (.bat) file in Java. We have used "exec()" command for running the batch file. Suppose we have created
exception in thread main while running servlet
exception in thread main while running servlet  I got exception in thread main no such method error while running servlet. I have added...\Tomcat 6.0\lib\servlet-api.jar;C:\Program Files\Apache Software Foundation
Running Java Applications as a Windows Service
Running Java Applications as a Windows Service  sample code for "Run a Java application as a Windows Service
chgrp command in java - Java Beginners
chgrp command in java  I used chgrp and chown two commands in java to change files properties like Runtime rt = Runtime.getRuntime(); String cmd = "/bin/chmod 777 " + exFile; Process proc = rt.exec(cmd); cmd = "/bin
How to Checking Syntax Error in PHP from Command Line
How to Checking Syntax Error in PHP from Command Line  Checking Syntax Error in PHP from Command Line   PHP allows you to check your script syntax without running the code. Just use the ?? l switch with php command
Java from JSP - JSP-Servlet
Calling Java from JSP  Does anyone have an example of Calling Java from JSP
command line arguments - Java Beginners
at the command prompt and then calculate the max and min numbers from them...command line arguments  how can i findout the minimum and maximum no's at the command prompt if i give some values?????????  hi friend
The Currently Running Servlet is showing some Previously run Servlet's Output
The Currently Running Servlet is showing some Previously run Servlet's... for example, I have executed the ParameterServlet servlet where the output... am executing another different servlet, It is showing the same output
Building and Running Java 8 Support
Building and Running Java 8 Support  As you know Java 8 is already released and available for download. Now I am developer of Java based projects. So... and run Java 8 application in Eclipse? Thanks   Hi, don't worry
Trouble with array manipulation
Trouble with array manipulation  For this project I have to print 10 random numbers from (0-99), print the max value, the average of the ten numbers... 16 14 68 80 23 This is the code i attempted, but i am having trouble putting
Java program to get the Command Line Arguments
Java program to get the Command Line Arguments       In java we can get the command  line... program takes arguments from the console and print it on the console. In our example
error of HTTP Status 404 while running servlet on apache tomcat server
error of HTTP Status 404 while running servlet on apache tomcat server  i have followed the steps given here.Also hava put servlet-api in lib folder... the apache tomcat page. It mean that my tomcat server is up and running. but whn i
Java Generic program with command line argument
Java Generic program with command line argument  Implement Generic to perform arithmetic evaluation using command line argument by using Java
Java Break command
Java Break command       Java Break command is commonly used in terminating looping statements. break command comes under the Java branching statements category. In programming
 

 

 

DMCA.com