Unformatted OS Command Value

Phillip

Member
Hi Everyone,

I'm trying to run an OS-Command to open a file but when it copies the file name over it is cutting it off once it reaches any special characters. For example assume the below:

Code:
def var filepath as char no-undo.

filepath = "\\nas\company\drawings\product(x).pdf".

os-command silent value(filepath).

What I am getting as the os-command is "\\nas\company\drawings\product". Does anyone know what I'm doing wrong?

Thanks!
 

TheMadDBA

Active Member
If you have spaces or special characters you need to put quotes around those portions of the file path. So in this exact case:

filepath = "\\nas\company\drawings\~"product(x).pdf~"".
 

Phillip

Member
Do you know how I could systematically do this? I am having the file location dump to a variable in an app and then I need to be able to run it when passed to an OS-Command. Can the tilde be put at the beginning of the strand somehow?
 
Top