• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Tim Cooke
  • Liutauras Vilda
  • Jeanne Boyarsky
  • paul wheaton
Sheriffs:
  • Ron McLeod
  • Devaka Cooray
  • Henry Wong
Saloon Keepers:
  • Tim Holloway
  • Stephan van Hulst
  • Carey Brown
  • Tim Moores
  • Mikalai Zaikin
Bartenders:
  • Frits Walraven

executing bat file in jsp

 
Ranch Hand
Posts: 72
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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 ]
 
Rancher
Posts: 43081
77
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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?
 
Java Cowboy
Posts: 16084
88
Android Scala IntelliJ IDE Spring Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
thank you

i got it by giving absolute path in bat file
 
I’m tired of walking, and will rest for a minute and grow some wheels. This is the promise of this tiny ad:
Gift giving made easy with the permaculture playing cards
https://coderanch.com/t/777758/Gift-giving-easy-permaculture-playing
reply
    Bookmark Topic Watch Topic
  • New Topic