Author:  Joel Yoker, Principal Consultant

 

A reader recently sent in a question about the GPO Import script and a syntax error they received at line 356.  We were able to reproduce the error and it appears to be a "cut and paste" error between the blog post and Notepad.  It appears that that carriage returns are added between each line when you cut the text from the blog post in Internet Explorer and paste it directly into Notepad.

 

Here are the lines that are causing the syntax error:

 

WScript.Echo   "USAGE: cscript.exe //nologo " &  WScript.ScriptName & " [/OPTIONS]" & _

 

VbCrLf & _

 

Etc...

 

If you take out the extra lines added during the “cut and paste”, the script runs fine and the "& _" sections of the statement work without the syntax error.  Essentially, this block of code needs to look like this:

 

WScript.Echo   "USAGE: cscript.exe //nologo " &  WScript.ScriptName & " [/OPTIONS]" & _

VbCrLf & _

VbCrLf & "Script to import FDCC Group Policy Objects (GPO)" & _

VbCrLf & "into a given Active Directory domain. (Note: Requires" & _

Etc...