Log In    |    Knowledge Base    |    4D Home
Tech Tip: File path with spaces passed as argument to Launch External Process
PRODUCT: 4D | VERSION: 2004.4 | PLATFORM: Mac & Win
Published On: September 8, 2006

When using the Launch External Process command to execute an application where you pass an argument to a path file that contains spaces, double quotes (“) should be added to both sides of the argument. The Launch External Process command allows you to execute an executable application and open a specific file. You pass the path to the application and the path to the file to be opened as argument. For instance, to open a word document, simply pass the path to the Word application and pass the path to the word document as well. However, if the path to the word document contains spaces, you will need to enclose the path in double quotes. For example as shown below, the file path for “test 2.doc" is in between double-quotes.

$mydoc:="C:\\Program Files\\Microsoft Office\\Office11\\WINWORD.EXE \"C:\\My Doc Files\\test 2.doc\""


Notice the escape character ‘\’ before the double quote(“) to make it part of the path string.