Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6958101
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T15:05:48+00:00 2026-05-27T15:05:48+00:00

I have an application that I run on a pc with a mouse, I

  • 0

I have an application that I run on a pc with a mouse, I want to launch edrawingsviewer with a particular file name from java and then when the user returns to the fullscreen app, if they haven’t closed it I want to close it. This is what I’ve got so far for a quick demo but I cannot figure out what to put in the arguments in order to launch solidworks with a particular file.

package com.protocase.hmiclient.edrawings;

import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import java.io.File;
import java.io.FilenameFilter;
import java.io.IOException;
import javax.swing.JButton;
import javax.swing.JFrame;

/**
 * @author DavidH
 */
public class EDrawingHelper {

    public static File[] getEDrawingsForJob(final String jobNumber) {
        File f = new File("\\\\itsugar\\www\\HMI\\POD EDRAWINGS");
        File[] matchingFiles = f.listFiles(new FilenameFilter() {
            public boolean accept(File dir, String name) {
                return name.startsWith(jobNumber) && (name.endsWith("EASM") || name.endsWith("EDRW"));
            }
        });
        return matchingFiles;
    }
    public static void test(String[] args) {
        File[] files = getEDrawingsForJob("G080111004-13162-1");
        for (File file : files){
            System.out.println(file.getName());
        }
    }
    public static void openEDrawingForFileName(String fileName){
        try {
            final Process process = Runtime.getRuntime().exec("C:\\Program Files\\SolidWorks Corp\\SolidWorks eDrawings (2)\\EModelViewer.exe  \\\\itsugar\\www\\HMI\\POD EDRAWINGS\\"+fileName);
            JFrame frame = new JFrame();
            JButton killButton = new JButton("KILL");
            killButton.addActionListener(new ActionListener() {
                @Override
                public void actionPerformed(ActionEvent e) {
                    process.destroy();
                    System.exit(0);
                }
            });
            frame.getContentPane().add(killButton);
            frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
            frame.pack();
            frame.setVisible(true);
        } catch (IOException e) {
            e.printStackTrace();
        }
    }
    public static void main(String[] args) {
        openEDrawingForFileName("G080111004-13162-1 ASSEMBLY.EASM");
    }
}

I don’t think this is a solidworks problem, I think this is just something I’m passing wrong or formatting wrong or something.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-27T15:05:49+00:00Added an answer on May 27, 2026 at 3:05 pm

    It appears as if running it through the FileProtocolHandler causes it to open fine.

    final Process process = Runtime.getRuntime().exec("rundll32 url.dll,FileProtocolHandler \\\\itsugar\\www\\HMI\\POD EDRAWINGS\\"+fileName);
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

If you have a web application that will run inside a network, it makes
I have an application that I have to run as Administrator. One small part
I have an application (winform exe) that I run several times. Does this mean
I have a 32-bit application that must run on a Windows x64 server using
I have a WPF application that will always run on windows 7, it opens
I have VB application that requires visual service pack 6 to run , now
I have an application that when it first starts i need it to run
I have an application that takes a couple of seconds to run. Is it
I have a delphi (Win32) web application that can run either as a CGI
I have a semi-large web application that we run locally and I need to

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.