Your application may get confused if it is expanding the variables in the line - you may need to escape the "$" on the "$sPath" to ensure that your app does not expand it.

What is the application that you are using to call the KiXtart script?