Open a file in default text editor

Hi,
how can i open a file in a given file path with windows specified application. eg. if i want to open *.txt and if windows generally opens it in notepad then it should open in notepad, or if it generally opens in any other text editor like text pad then it should open in text pad.
if not possible then what is the best way to open a text file in predefined text editor?
thanks

hi,
I do know how to open it with notepad:try
String cmd = "Notepad " + filename;
Process p = Runtime.getRuntime().exec(cmd);
catch(Exception e)
e.printStackTrace ();
}It is possible to open it with the standard texteditor, certainly by retrieving it from the windows registry. Perhaps there is a routine for it like for Internet Explorer but that I don't know.
greetz,
Stijn
P.S. to test these commands you can go to start > run, enter notepad (or any other command) and click OK

Similar Messages

  • [SOLVED] How to open default text editor from bash script?

    as header states i would like my script to open the desktops default text editor. I use xfce.
    I currently have it set to open medit, however i want to be able to use script on other desktops
    Last edited by orphius (2013-07-12 07:24:34)

    Trilby wrote:
    EDITOR will often not be the default desktop environment editor - it is usually limited to being a systemwide (and usually console-ready) editor.
    xdg-open, or a related tool, can give you the desktop's text editor.
    Truth. VISUAL is typically used for the graphical text editor.
    So, to use VISUAL if it exists, but otherwise default to medit, do:
    editor="${VISUAL:-medit}"
    $editor foo.txt
    Last edited by jakobcreutzfeldt (2013-07-11 07:09:02)

  • Set default text editor (no type, creator or extension)

    I would like BBedit to be the default text editor not TextEdit.
    I work in Terminal a lot and often encounter files that were sent to me by someone using Linux and have no type, creator or extension. I want these to open in BBedit not TextEdit.
    The problem can be recreated like this:
    Create an empty file in the Terminal like this:
    %touch testfile
    Select testfile in the Finder and set BBedit as the application to open this file. Click the "Change all" button to make this global.
    I then get an error about there being not enough information. I'm given the option to update and I do.
    Then double clicking on testfile does, in fact, open the file in BBedit.
    Now the rub. If I then generate another file called testfile2 like this:
    %touch testfile2
    Testfile 2 opens in TextEdit when double clicked in the Finder.
    What am I doing wrong?

    I'm not sure how to set a default for files like that. What I do for files that aren't cooperative like that is just have BBEdit (well, actually, TextWrangler for me) on the Dock and then just drag and drop them.
    You could potentially use an AppleScript or shell script to set the creator code to 'R*ch' for a batch of files. Type and creator codes used to be the Mac's alternative to extensions, but they were unfortunately left behind in Mac OS X, since the rest of the computing world didn't understand them. There's still support for them hiding in the OS, though. Looks like there's a script that'll do the trick here:
    http://scriptbuilders.net/files/setcreatorcodeofselection1.0.html

  • Make Pages default text editor

    How do I make Pages the default text editor? (Double click a .txt file and Pages opens instead of Appleworks)

    Hello kelwhite01,
    welcome to the Pages Discussions. Select a ".txt" Document in a Finder window and open the Infowindow for it (shortcut: "command" and "i"). In the middle of the window you see a section titled "Open with". There you can choose the app you want to open the selected document with. After choosing Pages, press the button at the bottom of the section to order the system to open every document of that type with Pages.

  • Default text-editor

    When I download a text-file in Safari, by default TextEdit is launched. Unfortunately, it cannot recognise the numerous fields in the Word-documents that are involved.
    Can I change the default text-editor to Word ?

    paieye wrote:
    I am not quite sure what you have in mind when you say to select the file-icon. I find the link in Safari, and click on it. That produces the 'Downloads' window, which eventually shows the file as downloaded. I can put the focus on to the row containing the file name, but I cannot highlight it. What ought I to be doing ?
    Find the file in the Downloads folder in your Home folder, not in the Downloads window. Then do as suggested.

  • Pages - Default Text Editor?

    How can I make Pages my default text editor?

    Hi DennisG,
    Thank you for the link. Now I have it, small file download. Yes it does look interesting, it will be fun to play around with getting to know it.
    On a side note to both you and Yvan: Back in my Windows days I did MS Office tech support. That caused me to became quite a Word junky creating specialty docs, brochures, and the like. With the arrival of Pages rarely do I use Word, only when someone needs assistance with a Word doc. I've moved to Pages, for what I do it's so much better than Word 2004 (don't have 2008).
    Some friends using AW want help with their AW thingys, so to assist them I reinstalled AW. Wow, I question why for years I hadn't used it: now I use AW more than Pages and Numbers. It amazes me how fast AW is, plus I like the DB as well. Yes the word processor and spreadsheet aren't as graphical as Numbers and Pages however, the print outs are very good, and both modules do numerous things Pages and Numbers yet cannot do.
    The more I use AW the more I understand why folks wished Apple, rather than start iWork from scratch, ported AW to iWork. Let's hope the next version of iWork will catch up to AW becoming the cats meow perhaps.
    Again thank you for the Bean link.
    Sincerely,
    RicD
    Sincerely,
    RicD

  • Setting pages to open .doc files by default

    I have iWork '08 but not MS Word on my MBP. When I get an e-mail attachment that is a .doc file (or an .xls file), I need to save it to the desktop and then open it with Pages or Numbers. Same with old Word files--I can't just open them in Pages by double clicking. Is there a way that I can tell Pages to open these files by default?

    I'm not trying to race you, just get it right.
    There was a smiley, whas it not clear enough
    Don't worry against Safari.
    At this time, when I am on ebay, one feature is broken from Safari but happily, it works under Firefox. Alas, in Firefox an other feature force the Mac to quit (under ebay) with a dialog which I never saw before:
    a black pane saying, in different languages, "you must restart the machine".
    Yvan KOENIG (from FRANCE lundi 13 octobre 2008 15:59:56)

  • Since yesterday all my usual .xls files will not open (Office for Mac 2011). Can open .xlxs files. Default 'open with' is Microsoft Excel.app. No software updates done. Have repaired disc permissions. What next?

    Since yesterday all my usual .xls files will not open (Office for Mac 2011). CAN open .xlxs files. Default 'open with' is Microsoft Excel.app. No software updates done yesterday or the day before (or maybe a Silverlight or an Acrobat one by accident?). Have repaired disc permissions. HHD name is still same as it always was. What next? Thanks
    PS I'm not a great techie so assume I don't know what you're talking about!

    You may need to rebuild permissions on your user account. To do this,boot to your Recovery partition (holding down the Command and R keys while booting) and open Terminal from the Utilities menu. In Terminal, type:  ‘resetpassword’ (without the ’s), hit return, and select the admin user. You are not going to reset your password. Click on the icon for your Macs hard drive at the top. From the drop down below it select the user account which is having issues. At the bottom of the window, you'll see an area labeled Restore Home Directory Permissions and ACLs. Click the reset button there. The process takes a few minutes. When complete, restart.   
    Repair User Permissions

  • How do you use Camera Raw Editor to open jpeg files by default, not using "Open As"?

    I've searched for the Camera Raw setting that is available from the Photoshop (not PSE8) menu but it is not even available in Photoshop Elements 8 that I've been able to see.  Does anyone know where this setting is?

    I had PSE8 set to open any file (tiff, jpeg and cr2) with the camera raw editor.  I can not figure out how it got changed or remember where to make this a default option in PSE8.  I found a video showing it available in Photoshop, main menu, camera raw and then you just check the boxes.  I've been looking for the similar setting in PSE8 again because I'm working through some exercises in a book and it is a nuisance to navigate to the image using the "open as" command every time.  I figured it would be just as easy to set the option by default, then, if I didn't want to use the raw editor, I could just click open from there.  Help?  Thanks so much!

  • Default text editor for files with no extension

    If I double-click on a file with a name like README, the Finder opens the file with TextEdit.app. I can easily change which editor is used if the file had an extension (e.g. if it was called README.txt or README.html), but without an extension, OS X had no way to set a preferred editor. If I open this from the terminal I can set the EDITOR environment variable, or use open -a appName, but my question is about the Finder. Thanks!

    extremely annoying. when i first switched to OS X, i had to rewite a hundred or so perl scripts for my servers... because any text file or data file or whatever, that didn't have an extension after it, would no longer open in BBEdit, like it always did in 9.2
    3 years later i'm still occasionally getting that annoying 'doh, what do i open this with' message. macs are getting dumber all the time.
    i guess apple thinks windows got it right associating the extension with the app.
    and half my 'change alls' don't stick either.

  • Setting default text editor for sql+ in win2k

    the define _editor=...command in sqlplus doesn't seem to be
    working for me. Can anyone shed a bit of light on how to make
    this work under windows 2000 pro? I want to get rid of notepad
    and replace it with NoteTab which is a much more advanced text
    editor over the stock m$ editor.
    thx in advance for any assistance.

    I'm using WIN2k and it works for me:
    DEFINE _EDITOR = "c:\program files\lemmy\lemmy.exe"
    SQL*Plus: Release 8.1.7.0.0 - Production on Tue Oct 23 13:35:09
    2001
    Microsoft Windows 2000
    5.00.2195
    Service Pack 2

  • Since install PE12 I cannot open raw files by default

    When I double click on a raw file to open, it opens in PE11 by default instead of newly installed PE12.  If I right click on any image file to select OPEN WITH PE11 shows by default.  I have added PE12 however, when I select it to OPEN WITH, PE12 launches by the file never opens.
    Operating System:  Win7 64bit

    Yes, Control Panel | Programs and Features | Uninstall or Change Program is exaclty what I was referring to and where I am looking.  As mentioned, neither PSE11 or PSE12 are listed.
    However, I was able to uninstall PSE11 using the Microsoft FIX IT tool.  The FIX IT tool removed the application or at least the parts that launch the app.  I had to manually go in an remove the PSE11 folder which required much playing with the folder permissions.
    Once PSE11 was removed I tried to associate the raw files on the computer to open with PSE12..  No luck!
    So, I ran the PSE12 setup which complained that PSE12 was already on the computer and needed to be removed.  So I selected the removal option.  However, once again the removal did NOT remove the PSE12 folder and all the files.
    I then ran the PSE12 installation again, this time installing the application and now all works as expected.  The RAW files are now associated with the PSE12 and open as expected.

  • Will Adobe X open TIFF files by default.

    Can Adobe X be set as default to open tiff files on Win 7 computer. .  If so .. how?

    What is "Adobe X"? Do you mean Adobe Acrobat X, or Adobe Reader X? Either
    way, they can't open TIFF files directly. Acrobat can convert Tiff files to
    PDF files and then show them, and Reader can't do anything with them at all.

  • Unable to open JSP files using Workshop JSP Editor 3.0

    Every time I try to open a JSP file in Workshop JSP Editor 3.0, I get the following error:
    Unable to create this part due to an internal error. Reason for the failure: Cannot open the specified document:
    null
    org.eclipse.ui.PartInitException: Cannot open the specified document:
    null
         at com.m7.wide.eclipse.jstudio.DynamicMultiPageEditor.A(Unknown Source)
         at com.m7.wide.eclipse.jstudio.DynamicMultiPageEditor.init(Unknown Source)
         at org.eclipse.ui.internal.EditorManager.createSite(EditorManager.java:778)
         at org.eclipse.ui.internal.EditorReference.createPartHelper(EditorReference.java:596)
         at org.eclipse.ui.internal.EditorReference.createPart(EditorReference.java:384)
         at org.eclipse.ui.internal.WorkbenchPartReference.getPart(WorkbenchPartReference.java:552)
         at org.eclipse.ui.internal.EditorReference.getEditor(EditorReference.java:223)
         at org.eclipse.ui.internal.WorkbenchPage.busyOpenEditorBatched(WorkbenchPage.java:2362)
         at org.eclipse.ui.internal.WorkbenchPage.busyOpenEditor(WorkbenchPage.java:2295)
         at org.eclipse.ui.internal.WorkbenchPage.access$9(WorkbenchPage.java:2287)
         at org.eclipse.ui.internal.WorkbenchPage$9.run(WorkbenchPage.java:2273)
         at org.eclipse.swt.custom.BusyIndicator.showWhile(BusyIndicator.java:69)
         at org.eclipse.ui.internal.WorkbenchPage.openEditor(WorkbenchPage.java:2268)
         at org.eclipse.ui.internal.WorkbenchPage.openEditor(WorkbenchPage.java:2249)
         at org.eclipse.ui.ide.IDE.openEditor(IDE.java:371)
         at org.eclipse.ui.ide.IDE.openEditor(IDE.java:334)
         at org.eclipse.ui.actions.OpenFileAction.openFile(OpenFileAction.java:98)
         at org.eclipse.ui.actions.OpenSystemEditorAction.run(OpenSystemEditorAction.java:98)
         at org.eclipse.wst.common.navigator.internal.actions.ResourceOpenListener.open(ResourceOpenListener.java:58)
         at org.eclipse.wst.common.navigator.internal.views.extensions.CommonOpenService.open(CommonOpenService.java:63)
         at org.eclipse.jface.viewers.StructuredViewer$2.run(StructuredViewer.java:741)
         at org.eclipse.core.internal.runtime.InternalPlatform.run(InternalPlatform.java:1044)
         at org.eclipse.core.runtime.Platform.run(Platform.java:783)
         at org.eclipse.ui.internal.JFaceUtil$1.run(JFaceUtil.java:44)
         at org.eclipse.jface.util.SafeRunnable.run(SafeRunnable.java:148)
         at org.eclipse.jface.viewers.StructuredViewer.fireOpen(StructuredViewer.java:739)
         at org.eclipse.jface.viewers.StructuredViewer.handleOpen(StructuredViewer.java:968)
         at org.eclipse.jface.viewers.StructuredViewer$6.handleOpen(StructuredViewer.java:1067)
         at org.eclipse.jface.util.OpenStrategy.fireOpenEvent(OpenStrategy.java:243)
         at org.eclipse.jface.util.OpenStrategy.access$2(OpenStrategy.java:238)
         at org.eclipse.jface.util.OpenStrategy$1.handleEvent(OpenStrategy.java:277)
         at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java:66)
         at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:843)
         at org.eclipse.swt.widgets.Display.runDeferredEvents(Display.java:3080)
         at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:2713)
         at org.eclipse.ui.internal.Workbench.runEventLoop(Workbench.java:1699)
         at org.eclipse.ui.internal.Workbench.runUI(Workbench.java:1663)
         at org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Workbench.java:367)
         at org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.java:143)
         at org.eclipse.ui.internal.ide.IDEApplication.run(IDEApplication.java:103)
         at org.eclipse.core.internal.runtime.PlatformActivator$1.run(PlatformActivator.java:226)
         at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:376)
         at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:163)
         at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
         at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
         at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
         at java.lang.reflect.Method.invoke(Unknown Source)
         at org.eclipse.core.launcher.Main.invokeFramework(Main.java:334)
         at org.eclipse.core.launcher.Main.basicRun(Main.java:278)
         at org.eclipse.core.launcher.Main.run(Main.java:973)
         at org.eclipse.core.launcher.Main.eclipse_main(Main.java:948)
         at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
         at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
         at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
         at java.lang.reflect.Method.invoke(Unknown Source)
         at com.m7.installer.util.NitroxMain$1.run(NitroxMain.java:29)
         at java.awt.event.InvocationEvent.dispatch(Unknown Source)
         at java.awt.EventQueue.dispatchEvent(Unknown Source)
         at java.awt.EventDispatchThread.pumpOneEventForHierarchy(Unknown Source)
         at java.awt.EventDispatchThread.pumpEventsForHierarchy(Unknown Source)
         at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
         at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
         at java.awt.EventDispatchThread.run(Unknown Source)
    The jsp file is present in its directory, and the directory is not linked. Reinstalling BEA Workshop doesn't help. Any suggestions?

    Please post this question to the bea.workshop.developer.general newsgroup at http://newsgroups.bea.com/bea/forum.jspa?forumID=600000007
    Thanks
    Raj

  • Can you open a file without default?

    when i go to open a file, it opens with a default program,  need to open it without anything, just by itself. It gets really annoying cause i cant find a simple fix. any help?

    A .dmg file is a data file, and like other data files, it is not itself "executable" - it requires a separate app to open it when it is double-clicked. In the case of a .dmg file you don't normally notice that separate app because the app resides in the System folder, doesn't appear in the Dock when it runs, and quits automatically when its job of mounting the .dmg disk image is done. It exists, though - its name is DiskImageMounter.app and it is located in the /System/Library/CoreServices folder. If you do a Get Info on a ,dmg file and look at the "Open with" section it should look like this:
    If your .dmg files seem to be opening by default in a different app, what is it?

Maybe you are looking for

  • Is it possible to call the import/export utilities from a procedure?

    I was just wondering if it is possible to call these utils as they are command line .exe's in Windows. Thanks Mike

  • Reset cleared ıtem FBRA massive z program sample?

    hi experts, I want to create zprogram which can reset mass documents but ı couldnt fınd any sample about that? I just explored original S* program (FBRA) but it has so much ınclude ,its lookng really hard to turn it massive So Is there anyone who can

  • Using xslt in pl/sql

    Hi! I have a simple question: how can I use xslt in pl/sql? I've tried this: DECLARE   v_XML  XMLTYPE;   v_XSLT XMLTYPE; BEGIN   SELECT XMLCol --it's a valid XML.     INTO v_XML     FROM tb_Controle;   SELECT XSLTCol --I don't know how to use XSLT.  

  • Customer Advance

    Hi   I am using A/R down payment invoice to link customer advance with sales order . Suppose Sales order value is 100000 , in A/r down payment invoice DPM i enter say 30000. Suppose customer pays 20,000 , i don't thing down payment invoice or down pa

  • [solved] virtualbox-ose-additions-modules and pacman -Syu

    I get the following error from my VM (Oracle VM VirtualBox) under Windows when doing a pacman -Syu: :: Starting full system upgrade... :: Replace kernel26-firmware with core/linux-firmware? [Y/n] resolving dependencies... looking for inter-conflicts.