vbs - 800A0401 - Expected End of Statement

Posted by user93200 on Super User See other posts from Super User or by user93200
Published on 2011-08-07T02:53:08Z Indexed on 2012/06/28 9:18 UTC
Read the original article Hit count: 165

Filed under:

The bat has >>%vbs% echo oShellLink.IconLocation = "%1, 0"to produce

oShellLink.IconLocation = ""C:\WINDOWS\NOTEPAD.exe", 0"`

where %1 is a quoted path

However, unless I remove the quotes from path like here:

oShellLink.IconLocation = "C:\WINDOWS\NOTEPAD.exe, 0"

I get the titular error. What do you suggest? (Note that %1 is always supplied with quotes)

Also, I'm not very familiar with vbscript, why does it require no quotes next to each other?

...

Still not clear why vbscript can't interpret this assignment, but found a fix: %~1 - Expands %1 and removes any surrounding quotation marks ("").

© Super User or respective owner

Related posts about vbscript