473,399 Members | 3,656 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,399 software developers and data experts.

Executing Batch file from Remote machine

Hi All,

I wrote code for executing batch file using java.but its not working..

Expand|Select|Wrap|Line Numbers
  1. package batchapp;
  2.  
  3. import java.io.IOException;
  4.  
  5. /**
  6. *
  7. * @author mahapatra.a
  8. */
  9. public class BatchApp {
  10.  
  11. /**
  12. * @param args the command line arguments
  13. */
  14. public static void main(String[] args) throws IOException, InterruptedException {
  15. // TODO code application logic here
  16.  
  17.  
  18.  
  19. Process p = Runtime.getRuntime().exec("\\\\192.168.1.xxx\\D\\D eleteME\\run.bat");
  20. p.waitFor();
  21.  
  22. System.out.println("deleted...");
  23.  
  24. }
  25. }
Its Urgent..please..:)

please Help me out..
Apr 14 '14 #1
1 4416
zmbd
5,501 Expert Mod 4TB
By, simply stating that your code "doesn't work," along with code that appears to have had very little if any troubleshooting performed, and expecting someone to help doesn't usually result in much of an answer and may result in your thread being deleted.

Instead, please tell us what you were expecting to happen, what actually happened, for each error: the EXACT title, error number, and descriptions that occurred and at what line in your posted code the error occurred. These are the minimum requirements for posting a question of this nature.

BTW: Please don't report your threads in order to get attention. (~_~)
Apr 14 '14 #2

Sign in to post your reply or Sign up for a free account.

Similar topics

2
by: Jon Maz | last post by:
Hi All, To allow myself to make development changes directly on a remote server *without* having to compile on my local dev machine and then upload the dll's to remote, I have created a...
9
by: Doug at SAU | last post by:
I need to run a batch file on a remote machine from an ASP page. I dummied up a test ASP page as follows: <% Set WshShell = Server.CreateObject("Wscript.Shell") wshshell.run...
2
by: carolineb2005 | last post by:
I have compiled this simple program which accept arguments on line using System; class HelloWorld { public static void Main(string args) { Console.WriteLine("Hello ", args); } }
0
by: KK | last post by:
Hi All I want to execute a batch file( containing some command ) from my MFC application. I'm using ShellExecute for this purpose,but some times my batch file returns error codes based on...
0
by: RajeevSekar | last post by:
Hi Experts, I am trying to invoke a batch(reside in my local machine) file from asp.net using System.diagnostics.process.start("path\filename") method, it is working fine, but when i try to...
0
by: =?Utf-8?B?Vmlua2k=?= | last post by:
hello Everyone, I created this batch file that executes the taskKill command to kill the process on the remote server. When I call this batch file from the console applications, it runs fine and...
2
jamesd0142
by: jamesd0142 | last post by:
Hi, I have a batch file on a remote server. if i use remote desktop to connect to this server and run the batch file it runs as i would expect. However i need to run this batch file from my...
1
by: Stout | last post by:
Is it possible to write some code that will launch a batch file on a remote machine? I want to run the code from my computer but have the batch file launch on the remote machine. Thanks.
0
by: =?Utf-8?B?UnVzdHlfUm9zZXI=?= | last post by:
Hi everyone, I'm having some issues figuring out how to complete certain tasks with a batch file, whether it be not knowing the right syntax or if it can even be accomplished with a batch file....
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.