Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsWhite Papers
Discussion GroupsFirst AidDatabasesJavaBeansGUIJava 3DVirtual MachineCORBASecurityToolsGeneral
Java DirectoryOpen Source ProjectsSample Book ChaptersUser GroupsWeb Resources
Related Topics
Databases.NETMore Topics ...

Java Forum / General / June 2006

Tip: Looking for answers? Try searching our database.

how to get 8.3 format filename from long filename

Thread view: 
jacobyv@sis.unibe.ch - 15 Jun 2006 10:56 GMT
hi

i've seen a few posts to this problem but didn't find a solution.

i want to open a document. it works fine if the path ist 8.3 format
compatible.

however, the example below does not work.

Runtime.getRuntime().exec("cmd.exe /c start c:\\temp\\long
filename.csv");

if i use the 8.3 dos format path it works.
Runtime.getRuntime().exec("cmd.exe /c start c:\\temp\\LONGFI~1.CSV");

how do i get the 8.3 format path in JAVA?
or is there another solution to open the file, without using the 8.3
format.

thanks a lot for your support.

greetings
yves
Roland de Ruiter - 15 Jun 2006 11:39 GMT
> hi
>
[quoted text clipped - 19 lines]
> greetings
> yves

Enclose the long filename in quotes. However, when the start command
sees a parameter with qoutes, it takes it as the title of the command
window (at least on WinXP). So you have to specify a (dummy) window
title as well:
...exec("cmd.exe /c start \"winttl\" \"c:\\temp\\long filename.csv\"");
Signature

Regards,

Roland



Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.