title: vbscript : unexpected identifier
body: <p>In my code I get the following error message </p>
  
  <blockquote>
    <p>c:\dpdata_copy2.vbs(114,13) Microsoft
    VBScript compilation error: Expected
    identifier</p>
  </blockquote>
  
  <p>line 114 points to a blank line so I assuemd it was throwing an error at the following line: </p>
  
  <pre><code>Lastprop = f.DateLastModified
  </code></pre>
  
  <p>in the code</p>
  
  <pre><code>strComputer = "."
  Set objWMIService = GetObject("winmgmts:\\" &amp; strComputer &amp; "\root\cimv2")
  
  strFolderName = "D:\1\production\Openjobs"
  
  Set colSubfolders = objWMIService.ExecQuery _
      ("Associators of {Win32_Directory.Name='" &amp; strFolderName &amp; "'} " _
          &amp; "Where AssocClass = Win32_Subdirectory " _
              &amp; "ResultRole = PartComponent")
  
      'variables for getting last accessed property
      Dim fs, f 
      Set fs = CreateObject("Scripting.FileSystemObject") 
  
  For Each objFolder in colSubfolders
  
      'get last modified date 
      Set f = fs.GetFolder(objFolder.Name) 
      Lastprop = f.DateLastModified
      'MsgBox(Lastprop)
  
              if ( DateDiff("m", f.DateLastModified, Now()) &gt; 4) then 
                  diffindates =  DateDiff("m", f.DateLastModified, Now())
                  Set objShell = CreateObject("Shell.Application")
                  Set objCopyFolder = objShell.NameSpace(ParentFolder) 
  
                  OutputToLog("rem " &amp; f.DateLastModified &amp; ":" &amp; objFolder.Name )
  
                  outputtolog("move /Y """ &amp; objFolder.Name &amp; """ "  &amp; ParentFolder)
  
                  wscript.echo(diffindates &amp; ":" &amp; objFolder.Name &amp; vbCr) 
  
              end if 
  
  Next
  </code></pre>
  
  <p>Any ideas? or should I post the entire script up?</p>