DMorris
08-22-2003, 08:31 AM
I'm trying to add a java program to the right-click context menu in Win2000.
The program takes a .txt file and converts it to various formats and then outputs a .zip file with all these different formats of the txt file within it.
I want to right-click a .txt file and be able to select RTC and then rtc (the java application) will convert the txt fie selected.
To run the application normally on say longtextfile.txt at a DOS prompt I simply use the following command:
C:\Program Files\Java\j2re1.4.1_02\bin\java.exe -classpath c:/rtc15/lib/rtcreator.jar -Drtc.converter.outputmode=1 com.unwiredtec.rtcreator.Converter longtextfile.txt
This would then output a zip file called longtextfile.zip with multiple files in that (each called longtextfile but with different extensions)
Now, to add this to the right-click menu for Win2000 I used the WAssociate program to add the following registry items:
HKEY_CLASSES_ROOT\txtfile\RTC HKEY_CLASSES_ROOT\txtfile\RTC\command a
nd the default string value for the command is: C:\Program Files\Java\j2re1.4.1_02\bin\java.exe -classpath c:/rtc15/lib/rtcreator.jar -Drtc.converter.outputmode=1 com.unwiredtec.rtcreator.Converter infile %1
The "Type" is set to "REG_EXPAND_SZ"
This seems to work OK as when I right click on a .txt file I can select RTC. However once rtc runs the zipfile it generates has changed the filename(s) to traditional DOS 8.3 format. Therefore if the original txt file was longtextfile.txt the converted zipfile will be LONGTE~1.zip and each converted file within that will be named LONGTE~1.xxx
Now I'm assuming for some reason the full file name is being shortened before it is passed to the java program as this problem doesn't happen if I run the program manually from dos.
Any idea how I can get the full filename passed through to the java application?
Thanks!
The program takes a .txt file and converts it to various formats and then outputs a .zip file with all these different formats of the txt file within it.
I want to right-click a .txt file and be able to select RTC and then rtc (the java application) will convert the txt fie selected.
To run the application normally on say longtextfile.txt at a DOS prompt I simply use the following command:
C:\Program Files\Java\j2re1.4.1_02\bin\java.exe -classpath c:/rtc15/lib/rtcreator.jar -Drtc.converter.outputmode=1 com.unwiredtec.rtcreator.Converter longtextfile.txt
This would then output a zip file called longtextfile.zip with multiple files in that (each called longtextfile but with different extensions)
Now, to add this to the right-click menu for Win2000 I used the WAssociate program to add the following registry items:
HKEY_CLASSES_ROOT\txtfile\RTC HKEY_CLASSES_ROOT\txtfile\RTC\command a
nd the default string value for the command is: C:\Program Files\Java\j2re1.4.1_02\bin\java.exe -classpath c:/rtc15/lib/rtcreator.jar -Drtc.converter.outputmode=1 com.unwiredtec.rtcreator.Converter infile %1
The "Type" is set to "REG_EXPAND_SZ"
This seems to work OK as when I right click on a .txt file I can select RTC. However once rtc runs the zipfile it generates has changed the filename(s) to traditional DOS 8.3 format. Therefore if the original txt file was longtextfile.txt the converted zipfile will be LONGTE~1.zip and each converted file within that will be named LONGTE~1.xxx
Now I'm assuming for some reason the full file name is being shortened before it is passed to the java program as this problem doesn't happen if I run the program manually from dos.
Any idea how I can get the full filename passed through to the java application?
Thanks!