AppletTalk.com Forum Index AppletTalk.com
Java discussions newsgroups
 
Archives   FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Running BAT/CMD files from java

 
Post new topic   Reply to topic    AppletTalk.com Forum Index -> Java Discussions
View previous topic :: View next topic  
Author Message
Name
Guest





PostPosted: Sun Feb 04, 2007 12:40 am    Post subject: Running BAT/CMD files from java Reply with quote



Hello,

I can't seem to execute a batch file from Java.

Runttime.getRuntime().exec("cmd.exe /c c:\\junk.cmd");

"cmd/c junk.cmd" works from the command line, but the above doesn't work
from java. I've even placed quotes around "c:\\junk.cmd" and used the full
path name to cmd.exe. Nothing seems to work.

NOTE: The junk.cmd file is a test batch file that deletes a file to detect
if the file has been executed and can execute binaries like notepad.

Any help appreciated
Back to top
Display posts from previous:   
Post new topic   Reply to topic    AppletTalk.com Forum Index -> Java Discussions All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2006 phpBB Group
SEO toolkit © 2004-2006 webmedic.