Advertisement
If you have a new account but are having problems posting or verifying your account, please email us on hello@boards.ie for help. Thanks :)
Hello all! Please ensure that you are posting a new thread or question in the appropriate forum. The Feedback forum is overwhelmed with questions that are having to be moved elsewhere. If you need help to verify your account contact hello@boards.ie
Hi there,
There is an issue with role permissions that is being worked on at the moment.
If you are having trouble with access or permissions on regional forums please post here to get access: https://www.boards.ie/discussion/2058365403/you-do-not-have-permission-for-that#latest

Regedit Parameter Problem

  • 26-09-2005 2: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