I never think quotes are optional (except - MAYBE - while golfing, but even that gives me the willies), but Doc just mentioned that unquoted strings usually work - that's all. Quoting the string is absolutely correct, and in my opinion, necessary.

For ITDaddy's benefit -

The "$" is the variable indicator in Kix - everything that follows it, letters, numbers, and some characters - forms a variable name. The "$" by itself is a legal variable name, often used as a "throw-away" var to catch return codes that aren't needed.

The process of converting variable names to their contents is called "variable expansion", and it - by default - occurs inside of strings. Most of us have decided that this is NOT a good thing, specifically for what you are experiencing here. You actually WANT a "$" inside the string, and not the content of a variable.

One way to do it is to "escape" the "$" by doubling it - Kix ignores variable expansion when it sees "$$" and simply puts a single "$" in its place. OK for "quick-n-dirty" scripts, but not for scripts that will see long-term use, or more advanced scripts.

A second form is the use of Chr(36), which is the "$" char. This always works, but is less obvious when debugging, or reading someone else's code.

What's preferred, and what you'll see in most of our scripts, is the command
$RC = SetOption('NoVarsInStrings', 'On')
This tells Kix to ingore the "$" inside of quoted strings (another reason ALL strings should be quoted). This is placed at the beginning of the script. Doing this will prevent any confusion of the "\\server\c$\folder" form of UNC paths.

There are other SetOption values that most of us use, and they force better programming habits by making you declare your vars before use and things like that. Get familiar with the basics of Kix first, then try turning on "Explicit" and see if you declared all your vars..

Glenn
_________________________
Actually I am a Rocket Scientist! \:D