Hi, My program generates a text output file. I'm opening notepad like this: Runtime.getRuntime().exec("notepad"); It works fine. The question is how can I get a specific .txt file to open using this? Does anyone know the syntax to add the path so that I can point it to the directory (output) and file name (output.txt) where the program generates it to (c:\output\output.txt)? Thanks, steve
Cindy Glass
"The Hood"
Sheriff
Joined: Sep 29, 2000
Posts: 8521
posted
0
Runtime.getRuntime().exec("notepad c:\output\output.txt"); [This message has been edited by Cindy Glass (edited October 11, 2001).]
"JavaRanch, where the deer and the Certified play" - David O'Meara
steve dowdall
Ranch Hand
Joined: May 23, 2001
Posts: 36
posted
0
Cindy, I had to do this (Windows OS I guess?): Runtime.getRuntime().exec("notepad c:\\Development\\xml-java\\output\\xml-output.txt"); Otherwise I get this error: Invalid string literal, cannot contain character '\?'. Runtime.getRuntime().exec("notepad c:\Development\xml java\output\xml-output.txt"); Slan, Steve
Cindy Glass
"The Hood"
Sheriff
Joined: Sep 29, 2000
Posts: 8521
posted
0
Yeah - sorry about that . Of course since you figured it out yourself it will stick with you FOREVER .