Invoke the system text editor on autoexec.bat : WIN32 « SWT JFace Eclipse « Java






Invoke the system text editor on autoexec.bat



/*
 * Program example snippet: invoke the system text editor on autoexec.bat
 *
 * For a list of all SWT example snippets see
 * http://dev.eclipse.org/viewcvs/index.cgi/%7Echeckout%7E/platform-swt-home/dev.html#snippets
 */
import org.eclipse.swt.program.Program;
import org.eclipse.swt.widgets.Display;

public class Snippet30 {

  public static void main(String[] args) {
    Display display = new Display();
    Program p = Program.findProgram(".txt");
    if (p != null)
      p.execute("c:\\autoexec.bat");
    display.dispose();
  }

}

           
       








Related examples in the same category

1.Place an icon with a popup menu on the system trayPlace an icon with a popup menu on the system tray
2.SWT Ole FrameSWT Ole Frame
3.OLE and ActiveX example snippet
4.Word OLEWord OLE
5.Invoke an external batch fileInvoke an external batch file
6.Find the icon of the program that edits .bmp filesFind the icon of the program that edits .bmp files
7.Running a script within IE.Running a script within IE.
8.Reading and writing to a SAFEARRAY
9.Embed Word in an applet
10.OLE and ActiveX example: browse the typelibinfo for a program id
11.OLE and ActiveX example: get events from IE controlOLE and ActiveX example: get events from IE control
12.How to access About, Preferences and Quit menus on carbon