Results 1 to 2 of 2

Thread: How to call exe from jsp dynamically without hardcoding file path

  1. #1
    Join Date
    Apr 2007
    Posts
    1
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Unhappy How to call exe from jsp dynamically without hardcoding file path

    Hi all,
    I face some problem, I want to run exe from JSP. I can run it but I need to give full path of file. I want to call dynamically without hardcoding fullpath. Just giving filename.

    I don't want

    exec ("C:\Program File\Coro\sign.exe");

    I want

    exec("sign.exe")

  2. #2
    Join Date
    Sep 2005
    Location
    India
    Posts
    1,627
    Thanks
    6
    Thanked 107 Times in 107 Posts

    Default

    I don't know for sure but what about using the getRealPath method available in ServletContext interface.

    Refer the docs from here

    This method will give you the actual physical path of the executable file without hard coding the path in the source code.

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •