Click here for important information about

txt file name into a batch variable

March 28, 2011 at 18:32:37
Specs: Windows XP
Here's my problem.
I want to write a batch script that automaticly runs Javac to create a class script from a .Java file by dragging the .java file onto the batch script. My script so far is as such.

set file=

Path=%path%;C:\Program Files\Java\jdk1.6.0_24\bin
cd c:\myprogs
javac %file%

as it stands, I can edit the file variable by hand in the batch script, but i want a drag and drop system. Any suggestions?

See More: txt file name into a batch variable

March 29, 2011 at 05:26:57
I imagine something like this:
Path=%path%;C:\Program Files\Java\jdk1.6.0_24\bin
cd /d "%~dp1"
javac "%~nx1"

How To Ask Questions The Smart Way

Report •

March 29, 2011 at 06:33:25
thank you very much! This works just as I was hoping.

Report •
Related Solutions

Ask Question