So I have a basic script that just prints out the parameters that are passed in:
projectName = ""
if Wscript.Arguments.Count > 0 then
projectName = Wscript.Arguments(0)
else
WScript.StdOut.WriteLine "No project specified"
end if
WScript.StdOut.WriteLine "Running script on project: " & projectName
When I run the script from the command line:
cit.vbs test
I get the message "No project file specified"
If I run it like this:
cscript vit.vbs test
I get the output: "Running script on project test"
Why is that?, why can't I pass a parameter in without specifying cscript at the start?
note I have configured my windows to run vbs files using cscript not wscript because I find wscript has weird issues and I don't want GUI elements - but that's a different question