Opening a file with an associated application

Ok, I have a project where I have to open a file or files
with the associated application on a local system. I have tried the
"open" command in lingo, the "ApplicationXtra.x32" xtra, "BuddyAPI"
xtra and the "FileXtra4" xtra. Each will open the application but
none will open the file path and name sent in the argument;
assuming any of the folders in the path or the filename itself has
spaces in it.
Here is an example of the code used for the lingo "open"
command:
open "E:\Working\PlotViews for Cleveland.dwg" with
"E:\Program Files\ACAD2000\acad.exe"
Here is an example of the code used for the
"ApplicationXtra.x32":
RunApp = new(xtra "ApplicationXtra")
RunApp.RunApp("E:\Program
Files\ACAD2000\acad.exe","E:\Working\PlotViewsforCleveland.dwg")
Here is an example of the code used for the "BuddyAPI":
ok = baShell( "open", "E:\Program Files\ACAD2000\acad.exe",
"E:\Working\PlotViews for Cleveland.dwg" , "E:\Working\", "normal"
And here is an example of the code used for the "FileXtra4":
FX = new xtra("FileXtra4")
FX.fx_FileRunApp("E:\Program Files\ACAD2000\acad.exe
E:\Working\PlotViews for Cleveland.dwg")
All of these crap out when there is a space anywhere in the
path or filename. Can anyone point me in the right direction?
Thanks for the help.

Well, to anyone who cares....I used the ShortFileName
function from BuddyAPI and BAM it works!

Similar Messages

  • I need to open a file with an associated programm.

    I need to open a file with an associated programm.
    I'm looking for two solutions:
    1. for Linux/Solaris/Unix/...
    2. for Windows 95/98/Nt/2000
    For Windows I have done this with command line
    Runtime.getRuntime().exec("rundll32 url.dll,FileProtocolHandler " + uSavePath);
    but it doesn't work on windows2000. We need an universal solution.
    For linux
    Process p = Runtime.getRuntime().exec("netscape openURL " + uSavePath);
    But may be anybody know better solution?

    You are right. For unix better solution is that my program to care about all association itself. As I undestend now it's a common solution for unix applications.
    But for windows it will be ugly enough. I've found another way for windows
    Win2000/NT: "cmd /C start filename /B"
    other Wins: start filename
    for linux I've stopped at doing this via Netscape.
    May be in future I'll make my property file.
    start filename - on Win95(may be 98/ME) returns -1 if file not assotiated with a programm, and doesn't shows openWith dialog. It solved using something like "rundll32 shell32, OpenWith filename"
    It's all for those how will solve this problem in future.

  • Open a file with its defualt associated application

    is there any way to open any file with its defualt associated application from a java program ?
    Example:
    In Windows I have a file example.txt and, from a java program, I would like opening it by the defualt associated application Notepad.
    Thx

    Take a look at this thread:
    http://forum.java.sun.com/thread.jsp?forum=31&thread=161228

  • Externally opening a file with the program its associated with

    Basically I'm looking to simulate what would happen if you double clicked on something in a windows explorer window. I want to have the operating system open a file with the application that as associated with it.
    how do I do it?

    Have you considered the portability issue?
    Win - Associate by editable user preferences
    Mac - Associate to creation program
    Unix/Dos - Explicitly associate program at command
    Rather than just using exec, you could look into something encapsulated to set which program to use so you could use on other system.

  • What application can you use to open a file with the .acc extension?

    What application can you use to open a file with the .acc extension?

    http://www.fileinfo.com/extension/acc

  • Cannot open TDM files with compiled applications

    I need to open TDM files using my EXE application, but it doesn't work in computers with only LabView Run Time installed. (It does if LabVIEW is installed, and it also does if I run my VIs). It doesn't display any error, and it doesn't extract any data.
    I've tried installing DSC Run Time as well, but it doesn't work either.
    Is this some Lisencing restriction?
    Do I need some extra installings?

    Regardless of the forum location ... make sure you have checked "NI USI" in your installer build specification.
    Herbert

  • When I try to open a file with adobe Bridge it will say that the parent application is not active, how can I fix this??

    When I try to open a file with Bridge the following message appears:
    I already re-installed PS CC and I can open the files trough Photoshop CC but not through bridge.Any advice please??

    BOILERPLATE TEXT:
    Note that this is boilerplate text.
    If you give complete and detailed information about your setup and the issue at hand,
    such as your platform (Mac or Win),
    exact versions of your OS, of Photoshop (not just "CS6", but something like CS6v.13.0.6) and of Bridge,
    your settings in Photoshop > Preference > Performance
    the type of file you were working on,
    machine specs, such as total installed RAM, scratch file HDs, total available HD space, video card specs, including total VRAM installed,
    what troubleshooting steps you have taken so far,
    what error message(s) you receive,
    if having issues opening raw files also the exact camera make and model that generated them,
    if you're having printing issues, indicate the exact make and model of your printer, paper size, image dimensions in pixels (so many pixels wide by so many pixels high). if going through a RIP, specify that too.
    A screen shot of your settings or of the image could be very helpful too,
    etc.,
    someone may be able to help you (not necessarily this poster, who is not a Windows user).
    Please read this FAQ for advice on how to ask your questions correctly for quicker and better answers:
    http://forums.adobe.com/thread/419981?tstart=0
    Thanks!

  • Opening a file with FILE_SHARE_DELETE mode (Only on Windows)

    Hi,
    We have an application that imports logs from several 3rd party vendor's applications. Basically what we do is import the logs in real time, i.e we do have a live FileInputstream connection to the log file. Now, when the 3rd party applications that rotate these logs (many of them do when they grow big or scheduled periodically), all unix flavors dont see to have any problem, while the windows does complain that the device or resource is busy and the original application is not allowed to rotate it. When i dug into the native code of windows jvm, i found that the file is not opened in the FILE_SHARE_DELETE mode and only with FILE_SHARE_READ and FILE_SHARE_WRITE modes. When we wrote a separate C++ application the opens a file with FILE_SHARE_DELETE mode, we found that the logs are rotatable.
    Now, how can we instruct the JVM to open a file with FILE_SHARE_DELETE mode? Is there any such implementation already or do i have to come up with another class extending the FileInputStream and use a totally different open method where the file is opened with this mode in the native code?
    Thanks
    Manava

    Hello,
    I think you can write :
    Runtime.getRuntime().exec("start.exe " + MyFileDialog.getDirectory() + MyFileDialog.getFile());
    So, "start.exe" choose the application (not valid for NT machine), ".getDirectory()" return the PATH and ".getFile()" return the NAME.
    Best regards from France
    Thierry

  • Error in opening a file with name in chinese characters with Runtime.exec

    The issue at hand is when I try to open a file with file name containing chinese characters in a localized environment in Windows through the following java code:
    Runtime.exec("rundll32 SHELL32.DLL,ShellExec_RunDLL {File_With_FileName_containing_Chinese_character}");
    the following error is thrown by windows.
    Cannot open file "C:\??.txt".
    with the exception
    java.io.IOException: CreateProcess: [Ljava.lang.String;@f5da06 error=2
            at java.lang.Win32Process.create(Native Method)
            at java.lang.Win32Process.<init>(Win32Process.java:66)
            at java.lang.Runtime.execInternal(Native Method)
            at java.lang.Runtime.exec(Runtime.java:566)
            at java.lang.Runtime.exec(Runtime.java:428)
            at java.lang.Runtime.exec(Runtime.java:364)
            at java.lang.Runtime.exec(Runtime.java:326)
            at Launcher.main(Launcher.java:26)
    When I try to use the same command (shown below) from the Windows Run command, the file opens sucessfully
    rundll32 SHELL32.DLL,ShellExec_RunDLL {File_With_FileName_containing_Chinese_character}
    Please suggest.
    Thanks in advance

    This may be a file association problem.  To solve that:
    In Windows 7:
    1. Right-click the file,
    2. Select "Open With" 
    select [Your Program Here]
    3. Check always use this program. 
    In Windows XP:
    1. Locate the file as you have described above
    2. Right click the file
    3. Select Open with from the pop-up menu
    4. Click Choose default program…
    5. Select Excel in the Recommended Programs box
    6. Check Always use the selected program to open this kind of file
    7. Click on OK.
    1.  Make Excel not available from Office 2007 listed under Programs and Features in Control Panel.
    2. Take a registry backup using the steps given here
    3. In the registry editor window expand HKEY_CLASSES_ROOT and navigate to .xls right and delete it.
    4. Exit Registry Editor
    5. Undo Step 1 to make Excel available.
    6.  Restart the computer and verify it the issue is fixed.
    If this answer solves your problem, please check Mark as Answered. If this answer helps, please click the Vote as Helpful button. Cheers, Shane Devenshire

  • Opening a file with custom FileDialog. (VERY URGENT)

    hi everybody,
    I have a problem and stuck. I have developed a MDI application that provides all function like open saved files, create new, edit and lots of other. It only opens, save ,edit etc the graphical diagrams inside JInternalFrames. I have an icon on my desktop when clicked opens this Application. Just like Editplus, Word or some other application when you click on the icon it opens that. Same way I have created such functionality.
    Now instead of this I have created a custom FileDialogfrom which the user selects this application and is opened. Now I have small icon for this FileDialog on the desktop when opened gives the interface to select the files to be opened. My FileDialog just looks like the FileDialog but some more functionality and more components like JComboBox, Jlist, JtextField, JButtons etc. in it and have removed some of them. I am extending JDialog. But now my probelm is when you select a file and click open, it should open the selected file. How can I achive this functionality in my custom FileDialog as I am not extending FileDialog and as it is built in the FileDialog. How can I open the files with any extension in it's related application e.g .doc files to be opened in MicrosoftWord, .txt to be opened in notepad, .c or .cpp in Visual Studio C++ etc.
    How can I put this kind of functionality in my custom FileDialog. It's really important for me please any comments will help me alot. Thanks for the help

    Hello,
    I think you can write :
    Runtime.getRuntime().exec("start.exe " + MyFileDialog.getDirectory() + MyFileDialog.getFile());
    So, "start.exe" choose the application (not valid for NT machine), ".getDirectory()" return the PATH and ".getFile()" return the NAME.
    Best regards from France
    Thierry

  • Help - "Acrobat is being used by another application and cannot open PDF files until the other application is closed."

    Hello,
    I searched this site and google for this error terminology and come up dry.  I support a user who has been for years using Acrobat 5 (yes, I know...) to read files in a client DB program, as well as other PDF files on their PC.  In the last week or so, they have started gatting this error "Acrobat is being used by another application and cannot open PDF files until the other application is closed." any time they attempt to open a PDF file attached to an email (via Outlook).
    It is my understanding that they cannot upgrade to a newer version of Acrobat because of limitations of their client software, but had not previously had any issues viewing PDF notes from the DB, and PDF attachments in their email.
    I have tried uninstalling and re-installing, as well as tried using Adobe Reader 7 & 9 in conjunction with Acrobat to try to get around this issue, but have not been successful.
    Any ideas?
    Thanks,
    Jesse

    I don't have an answer to your technical problem. The product I assume is Acrobat that you are talking about (based on the post title), Adobe is the company name. This is a good place to ask questions on Acrobat if folks can figure out what you are talking about. They will ask for the product version number (like AA9.3.3), operating system, and other applications if appropriate. Also, just what you are doing that generates the message.
    As for Adobe, you are not likely to get an answer from them here in the user forum. You will be lucky if you can get an answer if you can contact them and not be on hold for more than an hour (sorry, this is why a lot of folks end up in the forum).
    So, to help others try to answer your question, what are the products and versions involved? What OS? What are you doing when the message comes up.

  • How to open a file with a link ?

    I am using servlets to design an application.
    The application supports uploading and downloading of .DOC and .RTF files.
    My problem is that I am opening an uploaded file via a link.
    OPen File
    The above is also working fine and opens the file in the IE browser.
    But my problem is that I want to open the file with MS-Word...as is done on many resume-building websites.
    1) How am I supposed to do that ?
    2) Can I specify ContentType="application/msword" in a link ?
    Please Help !!

    I did the foll. w.r.t a docbase.
    A docbase stores documents and assigns an unique id to each one. The foll. is a code snippet that opens a document's contents in a browser.
    public void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException
    Connection conn = null;
    Statement stm;
    ServletOutputStream sos = null;
    ResultSet res;
    // .... get id of document u want to open
    query = "select id from .. where object_name = ' xx' .."
    res= stm.executeQuery(query);
    Blob blob = res.getBlob("_content"); // this will get content of document identified by id
    int blobLen = (int)blob.length();
    //the foll. is the part u need..
    if (blobLen > 0) {
    InputStream contents = blob.getBinaryStream();
    response.setContentType("application/msword"); // MS Word
    byte[] buf = new byte[blobLen];
    int length = -1;
           while ((length = contents.read(buf)) != -1){
              sos = response.getOutputStream();
              sos.write(buf,0,blobLen);
    sos.flush();
    System.out.println("Doc Received");
    contents.close();
      res.close();
      conn.close();
    }

  • I can't open PDF files with adobe flash player

    I have installed it and whenever I try to open pdf files it says I need to agree with your liscens and you do that automatically when you download it. I have followed all your instructions on your website and uninstalled it and installed again, but I can't open pdf files with it. I don't know what the problem is exactly, but it's really frustrating..

    Flash Player CANNOT open PDFs because they AREN'T Flash Documents.
    Adobe Reader opens PDFs.
    To accept the license agreement (NOT the one you accepted to download or install - the one for USE)
    Windows:
    Go to: C/Program Files(x86)/Adobe/Reader 11.0/Reader and double click the eula.exe file. The license agreement will open for you to accept.
    Mac:
    Go to: Mac HD/Applications and double click the Reader app. The license agreement will open THE FIRST TIME you open it.

  • Issues opening RAW files with CS2...

    I find if a bit complicated to open RAW files with Photoshop CS2 in iPhoto 08 (I'm using OS X 10.5). Currently the only way I've been able to do this is do a search for the file name in the finder, at the bottom of the Finder window, in the path, double click on the folder that the RAW files are in (user/my name/pictures/iphoto library/originals/2007/RAW files), then highlight the NEF files (the cameras a Nikon D200) I want to open, hit command/O then Photoshop CS2 opens the files in the RAW converter. If I try this from CS2 (command/O) the path goes as for as iphoto library (user/my name/pictures/iphoto library), at this point the iphoto library icon is ghosted out and can not be opened. If I drag and drop the image from iPhoto to the CS2 icon in the dock it opens as a jpg not the RAW file I need. If I try clicking my way to the folder from the left side of the finder, my name/pictures/iphoto library this is as far as I can go. There's something strange going on here. How can you go to a folder only one way and not the others? There seems to "hidden" folders now.
    So... My question (finally), how can I simply open RAW files from iPhoto 08 in CS2?

    In iPhoto's Advanced preferences select the checkbox under RAW Photos: "Use RAW when using external editor". That will open the Cr2 file in the raw editor. To get the edit to show in iPhoto you'll need to click on the Open Image button so the jpg version is created with the edits you made to the RAW file. Then when you save you'll need to navigate in the Save window to the Modified folder and save it into the folder representing the event that the original is in. It's not easy. I've not done much with RAW, just a few tests, so there may be an easier way to get iPhoto to recognize the edited version.
    If you don't use the Open File and close iPhoto won't display the edits you made to the RAW file.
    Do you Twango?
    TIP: For insurance against the iPhoto database corruption that many users have experienced I recommend making a backup copy of the Library6.iPhoto database file and keep it current. If problems crop up where iPhoto suddenly can't see any photos or thinks there are no photos in the library, replacing the working Library6.iPhoto file with the backup will often get the library back. By keeping it current I mean backup after each import and/or any serious editing or work on books, slideshows, calendars, cards, etc. That insures that if a problem pops up and you do need to replace the database file, you'll retain all those efforts. It doesn't take long to make the backup and it's good insurance.
    I've created an Automator workflow application (requires Tiger), iPhoto dB File Backup, that will copy the selected Library6.iPhoto file from your iPhoto Library folder to the Pictures folder, replacing any previous version of it. It's compatible with iPhoto 08 libraries. iPhoto does not have to be closed to run the application, just idle. You can download it at Toad's Cellar. Be sure to read the Read Me pdf file.

  • Cannot open pdf files with Firefox's built-in pdf viewer

    This just started (I think) with Firefox 37.01. This is on Win7-X64. I cannot open pdf files with the Firefox built-in pdf viewer. If I click on the file or try to open it from within Firefox, it brings up a "opening filename.pdf" message. If I select the "Open with" radio button as 'Firefox (default),' it just keeps looping on this process; it never opens. In Tools => Options => Applications, Portable Document Format (PDF) is indicated as 'Preview in Firefox.' I've never had any other PDF viewer installed on this computer. I've tried disabling all plug-ins and extensions, but it still doesn't work. I searched for solutions but haven't found any for this specific issue.
    Thanks for the help.

    Hello,
    Have you tried, to start Firefox in safemode you can do so by following these steps
    '''If Firefox is open,''' you can restart in Firefox Safe Mode from the Help menu:
    * Click the menu button [[Image:New Fx Menu]], click Help [[Image:Help-29]] and select ''Restart with Add-ons Disabled''.
    '''If Firefox is not running,''' you can start Firefox in Safe Mode as follows:
    * On Windows: Hold the '''Shift''' key when you open the Firefox desktop or Start menu shortcut.
    * On Mac: Hold the '''option''' key while starting Firefox.
    * On Linux: Quit Firefox, go to your Terminal and run ''firefox -safe-mode'' <br>(you may need to specify the Firefox installation path e.g. /usr/lib/firefox)
    When the Firefox Safe Mode window appears, select "Start in Safe Mode".
    ;[[Image:SafeMode-Fx35]]
    '''''If the issue is not present in Firefox Safe Mode''''', your problem is probably caused by an extension, theme, or hardware acceleration. Please follow the steps in the [[Troubleshoot extensions, themes and hardware acceleration issues to solve common Firefox problems]] article to find the cause.
    ''To exit Firefox Safe Mode, just close Firefox and wait a few seconds before opening Firefox for normal use again.''
    When you figure out what's causing your issues, please let us know. It might help others with the same problem.

Maybe you are looking for

  • Down loading pictures from MacBook Pro to iCloud

    I can't seem to figure out how to down load my pictures to my icloud account from my MacBook Pro.  Please help!  I need simple directions... Kind of a lamo when it comes to using anything TECHI!  thanks!

  • Problem in reterving graphs

    Hi i have to face the problem in reterving or displaying the graph..in a application..and plz help that in Regedit where i should give the path of the graph... plz help me in this regard thx in advance

  • How do i get the idvd program to cary out onestep dvd feature

    one step dvd feture on my idvd program will direct me to take certain actions, then will only repete the directions after i have completed the actions.

  • View content of DLL

    Hi, Is there a way to view the content (i.e. provided methods) of a windows DLL file? I am using same third party JNI API which provides a few DLLs and now I've got a new version and the method which is in the java native class can't be found in the

  • Heterogeneous Query, need help ASAP!

    Post Author: zen69 CA Forum: Data Connectivity and SQL Hi all! I'm trying to make a report that uses a view with linked table (tables from a linked server).I tested my view in  SQL Server and it's working but when I try to use it in my report I get t