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: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

View Answers

Ads









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
How to check if ZooKeeper is running or up from command prompt
How to check if ZooKeeper is running or up from command prompt  Hi, I want to see if the ZooKeeper is running or not on my Hadoop cluster. How to check if ZooKeeper is running or up from command prompt? Thanks   Hi
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
Running R script from command line
Steps of running R script from command line In the previous tutorial we... the script from command prompt without GUI. Here are the need of running R... will create a file for R script and then run this script from command line
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
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
Calling servlet from servlet .
Calling servlet from servlet .  How to call a servlet from another servlet in Java?   You can call another servlet by using... ServletException, IOException { System.out.println("Calling another servlet by using
DOS ATTACK
DOS ATTACK  JAVA CODE FOR MONITORING AND PREVENTION OF DOS ATTACK
Redirect from servlet to servlet
Redirect from servlet to servlet  I want to insert data from Text box... to redirectServlet , and from this servlet I want to again forward my page to insertServlet(i.e...; <servlet-name>redirectServlet</servlet-name> <servlet
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
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
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
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
calling servlet from jsp
calling servlet from jsp  how to call a servlet from jsp
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
Maven dependency for com.cedarsoftware - json-command-servlet version 1.1.1 is released. Learn to use json-command-servlet version 1.1.1 in Maven based Java projects
-command-servlet version 1.1.1 ) in their Java project if it is based on Maven...-command-servlet version 1.1.1 java library in your project. Now you can save...-command-servlet released The developers of   com.cedarsoftware - json
Maven dependency for com.cedarsoftware - json-command-servlet version 1.6.4 is released. Learn to use json-command-servlet version 1.6.4 in Maven based Java projects
-command-servlet version 1.6.4 ) in their Java project if it is based on Maven...-command-servlet version 1.6.4 java library in your project. Now you can save...-command-servlet released The developers of   com.cedarsoftware - json
Maven dependency for com.cedarsoftware - json-command-servlet version 1.9.1 is released. Learn to use json-command-servlet version 1.9.1 in Maven based Java projects
-command-servlet version 1.9.1 ) in their Java project if it is based on Maven...-command-servlet version 1.9.1 java library in your project. Now you can save...-command-servlet released The developers of   com.cedarsoftware - json
Maven dependency for com.cedarsoftware - json-command-servlet version 1.3.0 is released. Learn to use json-command-servlet version 1.3.0 in Maven based Java projects
-command-servlet version 1.3.0 ) in their Java project if it is based on Maven...-command-servlet version 1.3.0 java library in your project. Now you can save...-command-servlet released The developers of   com.cedarsoftware - json
Maven dependency for com.cedarsoftware - json-command-servlet version 1.4.3 is released. Learn to use json-command-servlet version 1.4.3 in Maven based Java projects
-command-servlet version 1.4.3 ) in their Java project if it is based on Maven...-command-servlet version 1.4.3 java library in your project. Now you can save...-command-servlet released The developers of   com.cedarsoftware - json
Maven dependency for com.cedarsoftware - json-command-servlet version 1.2.3 is released. Learn to use json-command-servlet version 1.2.3 in Maven based Java projects
-command-servlet version 1.2.3 ) in their Java project if it is based on Maven...-command-servlet version 1.2.3 java library in your project. Now you can save...-command-servlet released The developers of   com.cedarsoftware - json
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
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
How do I throw a 404 error from within a java servlet?
How do I throw a 404 error from within a java servlet?  How you can write code in Servlet for throwing the httpd error 404? How to add...;/location> </error-page> and in the servlet you can use the following
How to send boolean array to servlet from java application?
How to send boolean array to servlet from java application?  Hi, I want to send randomly generated array of boolean values. I used Random function... this data to servlet using Post method. I am then deploying that servlet on Google App
Passing java variables from JSP to Servlet - return null values
Passing java variables from JSP to Servlet - return null values  I want to pass some variables from a JSP page to a servlet. These variables are from... to get java variables from JSP tp servlet? If there is some error in my code
Java : Servlet Tutorials - Page 2
Java : Servlet Tutorials     ... data from this .java file..    Export data... to a servlet.   Quick Introduction to Java Servlets
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
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
Version of com.cedarsoftware>json-command-servlet dependency
List of Version of com.cedarsoftware>json-command-servlet dependency
execute dos commands
execute dos commands  how to execute dos commands using a java program
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
Getting Parameter from a css styled jsp file to a java servlet file...
Getting Parameter from a css styled jsp file to a java servlet file... ...; java servlet file-- /* * To change this template, choose Tools...;/code> methods. * @param request servlet request * @param response
how to fetch data from servlet ????
how to fetch data from servlet ????  how to fetch data from servlet
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
calling servlet from jsp in netbeans ide
calling servlet from jsp in netbeans ide  I have tried to call servlet from jsp code in netbeans for checking the database values . but while running it showing the error that the resource not available. i dono wat mistake i did
ModuleNotFoundError: No module named 'dos'
library. You can install dos python with following command: pip install...ModuleNotFoundError: No module named 'dos'  Hi, My Python program is throwing following error: ModuleNotFoundError: No module named 'dos
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
ModuleNotFoundError: No module named 'trouble'
to install padas library. You can install trouble python with following command...ModuleNotFoundError: No module named 'trouble'  Hi, My Python... 'trouble' How to remove the ModuleNotFoundError: No module named 'trouble
Getting data from servlet into javascript
Getting data from servlet into javascript  How do i get json data from my servlet on to a variable in javascript n bind the data to display onto sigma grid.Has anyone Idea how to do
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
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
calling servlet from JS and return response from servlet to JS
calling servlet from JS and return response from servlet to JS  hello...) which inturn calls a servlet(myServlet).servlet performs some DB related task.now i want this servlet(myServlet) to return a url(eg. pages/file.jsp
Maven Dependency json-command-servlet >> 1.1.0
You should include the dependency code given in this page to add Maven Dependency of com.cedarsoftware >> json-command-servlet version1.1.0 in your project
Maven Dependency json-command-servlet >> 1.2.0
You should include the dependency code given in this page to add Maven Dependency of com.cedarsoftware >> json-command-servlet version1.2.0 in your project
Maven Dependency json-command-servlet >> 1.2.3
You should include the dependency code given in this page to add Maven Dependency of com.cedarsoftware >> json-command-servlet version1.2.3 in your project
Maven Dependency json-command-servlet >> 1.3.0
You should include the dependency code given in this page to add Maven Dependency of com.cedarsoftware >> json-command-servlet version1.3.0 in your project
Maven Dependency json-command-servlet >> 1.3.3
You should include the dependency code given in this page to add Maven Dependency of com.cedarsoftware >> json-command-servlet version1.3.3 in your project

Ads