| Author |
Runtime.getRuntime().exec
|
Nagamani Srivastava
Greenhorn
Joined: Feb 02, 2009
Posts: 2
|
|
Hi All,
I am trying to open a file using Runtime.getRuntime().exec("cmd /C" + filepath). this doesn't work if I have brackets in the file name.
Say C:\My Workspace\Registry\ERPReports\ALV_Demo_Program_(Output_Simplest_version).csv
Can anyone help??
thanks & regards
Nagamani
|
 |
Paul Michael
Ranch Hand
Joined: Jul 02, 2001
Posts: 697
|
|
|
Did you try escaping (add a slash \ before special characters) the braces?
|
SCJP 1.2 (89%), SCWCD 1.3 (94%), IBM 486 (90%), SCJA Beta (96%), SCEA (91% / 77%), SCEA 5 P1 (77%), SCBCD 5 (85%)
|
 |
Jesper de Jong
Java Cowboy
Bartender
Joined: Aug 16, 2005
Posts: 12921
|
|
Welcome to JavaRanch.
You posted your question in the forum about the SCJA exam, but it looks like your question doesn't have anything to do with SCJA. I will move it to a more appropriate forum for you.
Please choose the appropriate forum when you post a question on JavaRanch.
|
Java Beginners FAQ - JavaRanch SCJP FAQ - The Java Tutorial - Java SE 7 API documentation
Scala Notes - My blog about Scala
|
 |
Nagamani Srivastava
Greenhorn
Joined: Feb 02, 2009
Posts: 2
|
|
if we add escape char before (, then my path string becomes invalid.
|
 |
Paul Michael
Ranch Hand
Joined: Jul 02, 2001
Posts: 697
|
|
Nagamani Srivastava wrote:if we add escape char before (, then my path string becomes invalid.
Ah sorry for that. Did you also try working on a directory name without spaces?
|
 |
 |
|
|
subject: Runtime.getRuntime().exec
|
|
|