Walt Forbes
asked on
How to convert a CMD script to a VBS script
I want the following command to be placed in a VBS file: "net localgroup Administrators /add "Domain\Group" ".
How should I format the VBS file to execute the "net localgroup" command given above?
How should I format the VBS file to execute the "net localgroup" command given above?
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
The single syntax error was the double back-slash (\\) after the "Domain" name - it should be a single back slash as in the base command (net localgroup Administrators /add Domain\Group).
I should have picked this up, but I thought that VBScripting the command somehow required the double back-slash.
Nonetheless, I declare this to be the solution!
I should have picked this up, but I thought that VBScripting the command somehow required the double back-slash.
Nonetheless, I declare this to be the solution!
ASKER
The JPEG shows 4 dialog boxes: the Active Directory group, the VBS script file contents, the 'null' result when CSCRIPT is used at the command prompt, and the unchanged contents of the local "Administrators" group.
VBS-Script-NoExecute.JPG