• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

executing bat file in jsp

 
biny panackal
Ranch Hand
Posts: 72
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hi to all.
Dear All

i have small doubght please help me..

I got a bat file which conatin a command to create a folder.i executed it in jsp
Runtime run =Runtime.getRuntime();
run.exec("C:\\sdf\\binnew.bat");


i run it fine.. but the folder not created..
why..?
if any body know it, please help me.
when i double click on the bat file its getting created
[ October 22, 2007: Message edited by: biny panackal ]
 
Ulf Dittmer
Rancher
Posts: 42968
73
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Are you using absolute paths in the batch file? Keep in mind that web apps do not have a concept of a default directory, if you use relative paths, it's not going to work.

Is there a reason you're not using File.mkdir to accomplish the same?
 
Jesper de Jong
Java Cowboy
Saloon Keeper
Posts: 15495
43
Android IntelliJ IDE Java Scala Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Also remember that JSPs are executed on the server and not on the client; if you were trying to create a directory on the client's computer, this will not work.
 
biny panackal
Ranch Hand
Posts: 72
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
i had just return "mkdir foldername" in the batfile..
nothing more in it.. is it necessory to use the ablsolute path
 
biny panackal
Ranch Hand
Posts: 72
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
thank you

i got it by giving absolute path in bat file
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic