Advertisement
Help Keep Boards Alive. Support us by going ad free today. See here: https://subscriptions.boards.ie/.
If we do not hit our goal we will be forced to close the site.

Current status: https://keepboardsalive.com/

Annual subs are best for most impact. If you are still undecided on going Ad Free - you can also donate using the Paypal Donate option. All contribution helps. Thank you.
https://www.boards.ie/group/1878-subscribers-forum

Private Group for paid up members of Boards.ie. Join the club.

Regedit Parameter Problem

  • 26-09-2005 02:42PM
    #1
    Registered Users, Registered Users 2 Posts: 1,967 ✭✭✭


    I'm trying to create a right-menu option that will use sun's javac to compile java source code and then pause so that the user can see the output. I've come up with this for the javafile key:

    cmd.exe /c "C:\j2sdk1.4.2_03\bin\javac.exe %1 | more && pause"

    However, %1 expands to a shortened version of the file path/name, e.g.:
    d:\DOCUME~1\user\MYDOCU~1\java\MYSECO~1.JAV which is a problem, as the javac compiler will not accept that as input. It needs the full file name (classname.java).

    Are there any other parameters instead of %1 that will provide a full path name? Or is there any other way of doing this?

    Thanks.


Comments

  • Closed Accounts Posts: 1,567 ✭✭✭Martyr


    Try:

    cmd.exe /c "C:\j2sdk1.4.2_03\bin\javac.exe %~f1 | more && pause"

    if that doesn't work, maybe write a small app to do it??

    how do you add right-click item to menu? through registry?
    can you tell us? :)


  • Registered Users, Registered Users 2 Posts: 1,967 ✭✭✭Dun


    Thanks for the suggestion, but googling (and trying), it seems that that only works in batch files. What I'm trying to do is add a right-click command for .java files in the registry without having to resort to batch files. I want to give this to a few people as a double-click registry file, so it's dummy-prof.

    Basically what is happening is that the company I work for have all computers locked down tight. There are about a dozen of us that are doing java training, and all we've been given is the java sdk, so it's only command line based. I've no problem with that, but most of these people wouldn't know a dir or cmd or rmdir if they got slapped with them in the face. So I want to come up with the above - they right click on the file, it compiles, and any output is displayed to them so they can deal with any errors in the source.

    The key I'm adding to the registry is:

    HKCU\Software\Classes\javafile\shell\Compile Java\command

    I'm using HKCU as, as you might imagine, HKLM is locked down.

    All this to compile, and I haven't even dealt with running the bytecode yet! Hopefully if I get this going it should just be only slightly different to the compile.


Advertisement