Welcome guest. Before posting on our computer help forum, you must register. Click here it's easy and free.

Author Topic: how to read the contents of a file and supply to an executable  (Read 2152 times)

0 Members and 1 Guest are viewing this topic.

karanbagh

  • Guest
how to read the contents of a file and supply to an executable
« on: December 21, 2007, 03:15:37 PM »
Hi,

I am not familiar with DOS commands.

I am trying to read the contents of a file and supply to an executable. So, I want to essentially do the UNIX equivalent on windows

java -cp `cat classpath.txt'

Thanks
Siva

karanbagh

  • Guest
Re: how to read the contents of a file and supply to an executable
« Reply #1 on: December 26, 2007, 09:58:22 AM »
I would to know how to use command "type filename.txt" and supply the contents as an argument to a program on the command line.

Thanks
Siva

karanbagh

  • Guest
Re: how to read the contents of a file and supply to an executable
« Reply #2 on: December 26, 2007, 11:42:18 AM »
This seems to work

for /f %%a in (classpath.txt) do (
java -cp %%a
)