Results 1 to 3 of 3
  1. #1
    itsnexgen is offline Member
    Join Date
    Sep 2008
    Posts
    9
    Rep Power
    0

    Question Passing filename to execute command in Java

    Hi,

    I am searching files based on extension. Now for each file found, want to run a command:

    Lets assume file found: C:\Home\1\1.txt
    My exe exists in: C:\Home\Hello.exe

    I would like to run command something like: "C:\Home\Hello.exe C:\Home\1\1.txt"

    similarly for C:\Home\ABC\2.txt - "C:\Home\Hello.exe C:\Home\ABC\2.txt"

    Kindly help me how to pass a searched file as an input to execute a command.

    Thanks,
    Kino

  2. #2
    PhHein's Avatar
    PhHein is offline Senior Member
    Join Date
    Apr 2009
    Location
    Germany
    Posts
    1,430
    Rep Power
    7

    Default Re: Passing filename to execute command in Java

    Math problems? Call 1-800-[(10x)(13i)^2]-[sin(xy)/2.362x]
    The Ubiquitous Newbie Tips

  3. #3
    DarrylBurke's Avatar
    DarrylBurke is offline Forum Police
    Join Date
    Sep 2008
    Location
    Madgaon, Goa, India
    Posts
    11,422
    Rep Power
    20

    Default Re: Passing filename to execute command in Java

    If you're forever cleaning cobwebs, it's time to get rid of the spiders.

Similar Threads

  1. java execute command every 10 seconds
    By bizkit1 in forum Android
    Replies: 2
    Last Post: 05-25-2012, 09:09 PM
  2. Replies: 8
    Last Post: 03-13-2011, 12:03 PM
  3. Execute Cygwin command from Java app
    By ZebraIzToronto in forum Advanced Java
    Replies: 1
    Last Post: 01-21-2011, 06:51 AM
  4. Execute a jar command from a java program
    By apremanandh in forum New To Java
    Replies: 3
    Last Post: 05-21-2008, 03:04 PM
  5. Unable to execute command line command in java
    By LordSM in forum New To Java
    Replies: 1
    Last Post: 08-08-2007, 01:23 AM

Posting Permissions

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