Trouble in running Dos Command from Java Servlet

Ads

 
 

Share on Google+Share on Google+

Sid
Trouble in running Dos Command from Java Servlet
0 Answer(s)      5 years and 8 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

Ads
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
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 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
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" 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
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
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
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
What is command prompt in Java?
What is command prompt in Java?  Hi, What is command prompt in Java... system them you can use the command prompt to compile the Java program. Command.... On the command prompt you can compile your Java program with following command: javac
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
DOS ATTACK
DOS ATTACK  JAVA CODE FOR MONITORING AND PREVENTION OF DOS ATTACK
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
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
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 from JSP - JSP-Servlet
Calling Java from JSP  Does anyone have an example of Calling Java from JSP
iperf command in java
iperf command in java  How to write a code for iperf command in java
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   
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
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
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
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
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

Ads

 
Advertisement null

Ads