Question Locked

Windows script escape character.

0 helpful
3 replies
Closed to new repliesThis discussion is closed. It stays readable, but it takes no new replies.

Hi,
Does any one know if there is such a thing.
I want to create a script with this in
objshell.run "net localgroup mygroup "mydomain\domain users" /add"
But it does not like the " around the domain users, I always get an expected end of statement error. Is it possible to escape it.
I have tried \ / ^ ` but no luck.

Thanks in advance.

3 replies

by lowlands

Set WshShell = WScript.CreateObject("WScript.Shell")

scommand = "net localgroup test " & Chr(34) & "mydomain\domain users" & Chr(34) & " /add"

wshShell.Run sCommand

This discussion is closed to new replies.