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









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... to explain you the process of compiling and running the Java program from command
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
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
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
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
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 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
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
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 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
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
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
DOS ATTACK
DOS ATTACK  JAVA CODE FOR MONITORING AND PREVENTION OF DOS ATTACK
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
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
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
Java from JSP - JSP-Servlet
Calling Java from JSP  Does anyone have an example of Calling Java from JSP
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
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
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
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
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
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...; com.cedarsoftware - json-command-servlet version 1.9.1 java library in your project. ADS...-command-servlet released The developers of   com.cedarsoftware - json
Maven dependency for com.cedarsoftware - json-command-servlet version 1.7.1 is released. Learn to use json-command-servlet version 1.7.1 in Maven based Java projects
-command-servlet version 1.7.1 ) in their Java project if it is based on Maven...; com.cedarsoftware - json-command-servlet version 1.7.1 java library in your project. ADS...-command-servlet released The developers of   com.cedarsoftware - json
Maven dependency for com.cedarsoftware - json-command-servlet version 1.6.1 is released. Learn to use json-command-servlet version 1.6.1 in Maven based Java projects
-command-servlet version 1.6.1 ) in their Java project if it is based on Maven...; com.cedarsoftware - json-command-servlet version 1.6.1 java library in your project. ADS...-command-servlet released The developers of   com.cedarsoftware - json
Maven dependency for com.cedarsoftware - json-command-servlet version 1.5.2 is released. Learn to use json-command-servlet version 1.5.2 in Maven based Java projects
-command-servlet version 1.5.2 ) in their Java project if it is based on Maven...; com.cedarsoftware - json-command-servlet version 1.5.2 java library in your project. ADS...-command-servlet released The developers of   com.cedarsoftware - json
Maven dependency for com.cedarsoftware - json-command-servlet version 1.5.0 is released. Learn to use json-command-servlet version 1.5.0 in Maven based Java projects
-command-servlet version 1.5.0 ) in their Java project if it is based on Maven...; com.cedarsoftware - json-command-servlet version 1.5.0 java library in your project. ADS...-command-servlet released The developers of   com.cedarsoftware - json
Maven dependency for com.cedarsoftware - json-command-servlet version 1.3.3 is released. Learn to use json-command-servlet version 1.3.3 in Maven based Java projects
-command-servlet version 1.3.3 ) in their Java project if it is based on Maven...; com.cedarsoftware - json-command-servlet version 1.3.3 java library in your project. ADS...-command-servlet released The developers of   com.cedarsoftware - json
Maven dependency for com.cedarsoftware - json-command-servlet version 1.3.1 is released. Learn to use json-command-servlet version 1.3.1 in Maven based Java projects
-command-servlet version 1.3.1 ) in their Java project if it is based on Maven...; com.cedarsoftware - json-command-servlet version 1.3.1 java library in your project. ADS...-command-servlet released The developers of   com.cedarsoftware - json
Maven dependency for com.cedarsoftware - json-command-servlet version 1.2.0 is released. Learn to use json-command-servlet version 1.2.0 in Maven based Java projects
-command-servlet version 1.2.0 ) in their Java project if it is based on Maven...; com.cedarsoftware - json-command-servlet version 1.2.0 java library in your project. ADS...-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...; com.cedarsoftware - json-command-servlet version 1.6.4 java library in your project. ADS...-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...; com.cedarsoftware - json-command-servlet version 1.3.0 java library in your project. ADS...-command-servlet released The developers of   com.cedarsoftware - json
Maven dependency for com.cedarsoftware - json-command-servlet version 1.6.0 is released. Learn to use json-command-servlet version 1.6.0 in Maven based Java projects
-command-servlet version 1.6.0 ) in their Java project if it is based on Maven...; com.cedarsoftware - json-command-servlet version 1.6.0 java library in your project. ADS...-command-servlet released The developers of   com.cedarsoftware - json
Maven dependency for com.cedarsoftware - json-command-servlet version 1.8.4 is released. Learn to use json-command-servlet version 1.8.4 in Maven based Java projects
-command-servlet version 1.8.4 ) in their Java project if it is based on Maven...; com.cedarsoftware - json-command-servlet version 1.8.4 java library in your project. ADS...-command-servlet released The developers of   com.cedarsoftware - json
Maven dependency for com.cedarsoftware - json-command-servlet version 1.8.3 is released. Learn to use json-command-servlet version 1.8.3 in Maven based Java projects
-command-servlet version 1.8.3 ) in their Java project if it is based on Maven...; com.cedarsoftware - json-command-servlet version 1.8.3 java library in your project. ADS...-command-servlet released The developers of   com.cedarsoftware - json
Maven dependency for com.cedarsoftware - json-command-servlet version 1.8.2 is released. Learn to use json-command-servlet version 1.8.2 in Maven based Java projects
-command-servlet version 1.8.2 ) in their Java project if it is based on Maven...; com.cedarsoftware - json-command-servlet version 1.8.2 java library in your project. ADS...-command-servlet released The developers of   com.cedarsoftware - json
Maven dependency for com.cedarsoftware - json-command-servlet version 1.8.1 is released. Learn to use json-command-servlet version 1.8.1 in Maven based Java projects
-command-servlet version 1.8.1 ) in their Java project if it is based on Maven...; com.cedarsoftware - json-command-servlet version 1.8.1 java library in your project. ADS...-command-servlet released The developers of   com.cedarsoftware - json
Maven dependency for com.cedarsoftware - json-command-servlet version 1.8.0 is released. Learn to use json-command-servlet version 1.8.0 in Maven based Java projects
-command-servlet version 1.8.0 ) in their Java project if it is based on Maven...; com.cedarsoftware - json-command-servlet version 1.8.0 java library in your project. ADS...-command-servlet released The developers of   com.cedarsoftware - json
Maven dependency for com.cedarsoftware - json-command-servlet version 1.7.0 is released. Learn to use json-command-servlet version 1.7.0 in Maven based Java projects
-command-servlet version 1.7.0 ) in their Java project if it is based on Maven...; com.cedarsoftware - json-command-servlet version 1.7.0 java library in your project. ADS...-command-servlet released The developers of   com.cedarsoftware - json
Maven dependency for com.cedarsoftware - json-command-servlet version 1.6.6 is released. Learn to use json-command-servlet version 1.6.6 in Maven based Java projects
-command-servlet version 1.6.6 ) in their Java project if it is based on Maven...; com.cedarsoftware - json-command-servlet version 1.6.6 java library in your project. ADS...-command-servlet released The developers of   com.cedarsoftware - json
Maven dependency for com.cedarsoftware - json-command-servlet version 1.6.5 is released. Learn to use json-command-servlet version 1.6.5 in Maven based Java projects
-command-servlet version 1.6.5 ) in their Java project if it is based on Maven...; com.cedarsoftware - json-command-servlet version 1.6.5 java library in your project. ADS...-command-servlet released The developers of   com.cedarsoftware - json
Maven dependency for com.cedarsoftware - json-command-servlet version 1.6.3 is released. Learn to use json-command-servlet version 1.6.3 in Maven based Java projects
-command-servlet version 1.6.3 ) in their Java project if it is based on Maven...; com.cedarsoftware - json-command-servlet version 1.6.3 java library in your project. ADS...-command-servlet released The developers of   com.cedarsoftware - json
Maven dependency for com.cedarsoftware - json-command-servlet version 1.6.2 is released. Learn to use json-command-servlet version 1.6.2 in Maven based Java projects
-command-servlet version 1.6.2 ) in their Java project if it is based on Maven...; com.cedarsoftware - json-command-servlet version 1.6.2 java library in your project. ADS...-command-servlet released The developers of   com.cedarsoftware - json
Maven dependency for com.cedarsoftware - json-command-servlet version 1.5.5 is released. Learn to use json-command-servlet version 1.5.5 in Maven based Java projects
-command-servlet version 1.5.5 ) in their Java project if it is based on Maven...; com.cedarsoftware - json-command-servlet version 1.5.5 java library in your project. ADS...-command-servlet released The developers of   com.cedarsoftware - json
Maven dependency for com.cedarsoftware - json-command-servlet version 1.5.4 is released. Learn to use json-command-servlet version 1.5.4 in Maven based Java projects
-command-servlet version 1.5.4 ) in their Java project if it is based on Maven...; com.cedarsoftware - json-command-servlet version 1.5.4 java library in your project. ADS...-command-servlet released The developers of   com.cedarsoftware - json
Maven dependency for com.cedarsoftware - json-command-servlet version 1.5.3 is released. Learn to use json-command-servlet version 1.5.3 in Maven based Java projects
-command-servlet version 1.5.3 ) in their Java project if it is based on Maven...; com.cedarsoftware - json-command-servlet version 1.5.3 java library in your project. ADS...-command-servlet released The developers of   com.cedarsoftware - json
Maven dependency for com.cedarsoftware - json-command-servlet version 1.5.1 is released. Learn to use json-command-servlet version 1.5.1 in Maven based Java projects
-command-servlet version 1.5.1 ) in their Java project if it is based on Maven...; com.cedarsoftware - json-command-servlet version 1.5.1 java library in your project. ADS...-command-servlet released The developers of   com.cedarsoftware - json
Maven dependency for com.cedarsoftware - json-command-servlet version 1.4.2 is released. Learn to use json-command-servlet version 1.4.2 in Maven based Java projects
-command-servlet version 1.4.2 ) in their Java project if it is based on Maven...; com.cedarsoftware - json-command-servlet version 1.4.2 java library in your project. ADS...-command-servlet released The developers of   com.cedarsoftware - json

Ads