
-----------------------------------
LegendsEnd
Mon May 22, 2006 7:11 pm

Using Sys.Exec with spaces
-----------------------------------
Using the Sys.Exec command, can the file I'm trying to run have spaces? If so, am I supposed to put an asterisk somewhere?

-----------------------------------
Tony
Mon May 22, 2006 8:01 pm


-----------------------------------
I'm think that it has to be in quotations, like

Sys.Exec("\"documents and settings\file\"")


-----------------------------------
LegendsEnd
Mon May 22, 2006 8:26 pm


-----------------------------------
I'm confused as to what you're saying. Right now I have code that looks like this:

if not Sys.Exec("A Document.doc") then
put "Failed"
end if

When I try it as "ADocument.doc" it works, with the space however it doesn't.
I have tried "A" + chr(32) + "Document.doc" which doesn't work, I have also tried making a string that stores "A Document.doc" and using that as the parameter but it doesn't work either.

-----------------------------------
[Gandalf]
Mon May 22, 2006 8:59 pm


-----------------------------------
Tony is using an escape character: \ to add a quote to the argument.  If you don't understand this, I'd suggest looking the subject up specifically (ie. escape characters).
We need a quote in the argument since without it the console will take "A" and "Document" as two seperate arguments because they are split up by a space.  When you put quotes around the whole argument, you are telling the console that it is all one big argument: "A Document".

-----------------------------------
LegendsEnd
Mon May 22, 2006 9:24 pm


-----------------------------------
Ah I see, thanks, got it working. Forgot that the \ allows characters like " ' ^
