title: VBScript Error code 800A0409, Unterminated string constant, on line 1
body: <p>I'm getting Error code 800A0409, Unterminated string constant, on line 1, 54 with the code below. </p>
  
  <pre><code>Option Explicit
  
  Dim ObjProgressMsg
  Dim fso,objText,strVstup,strVystup,f,dtmVyt,dtmF,dDiff,fName,fExt,fShort,dtmAkt,tx,msgText
  Dim strMessage,strWindowTitle,strTemp,wshShell,objTempMessage,strTempVBS
  
  
  Set fso = CreateObject("Scripting.FileSystemObject") 
  Set objText = fso.GetFile("l:\bat\posledni.den")
  strVstup = "l:\filefolder\"
  strVystup = "l:\backup"
  
  dtmVyt = objText.DateLastModified
  
  msgText = "Some text about copying and renaming" &amp; VbCrLf &amp; "files, please wait..."
  
  ProgressMsg msgText
  
  For Each f In fso.GetFolder(strVstup).Files
  
      dtmF = f.DateLastModified
  
      dDiff = DateDiff("s", dtmF, dtmVyt)
  
      If dDiff &lt; 0 Then
            ProgressMsg ""
            WScript.Echo f
      End If
  
  Next
  
  WScript.Echo "Some text about the task being finished."
  
  
  
  
  Function ProgressMsg( strMessage )
  ' Written by Denis St-Pierre
  ' Displays a progress message box that the originating script can kill in both 2k and XP
  ' If StrMessage is blank, take down previous progress message box
  ' Using 4096 in Msgbox below makes the progress message float on top of things
  ' CAVEAT: You must have   Dim ObjProgressMsg   at the top of your script for this to work as described
      Set wshShell = WScript.CreateObject( "WScript.Shell" )
      strTEMP = wshShell.ExpandEnvironmentStrings( "%TEMP%" )
      If strMessage = "" Then
          ' Disable Error Checking in case objProgressMsg doesn't exists yet
          On Error Resume Next
          ' Kill ProgressMsg
          objProgressMsg.Terminate( )
          ' Re-enable Error Checking
          On Error Goto 0
          Exit Function
      End If
          strTempVBS = strTEMP + "\" &amp; "Message.vbs"     'Control File for reboot
  
      ' Create Message.vbs, True=overwrite
      Set objTempMessage = fso.CreateTextFile( strTempVBS, True )
      objTempMessage.WriteLine( "MsgBox""" &amp; strMessage &amp; """, 4096, """ &amp; "a_sp_rano" &amp; """" )
      objTempMessage.Close
  
      ' Disable Error Checking in case objProgressMsg doesn't exists yet
      On Error Resume Next
      ' Kills the Previous ProgressMsg
      objProgressMsg.Terminate( )
      ' Re-enable Error Checking
      On Error Goto 0
  
      ' Trigger objProgressMsg and keep an object on it
      Set objProgressMsg = WshShell.Exec( "%windir%\system32\wscript.exe " &amp; strTempVBS )
  
  End Function
  </code></pre>
  
  <p>The script should show a msgbox while searching for files newer than last modified date of posledni.den file. Then once it finds a file it should close msgbox and echo the file it found.
  It works just fine if I change this:</p>
  
  <pre><code>msgText = "Some text about copying and renaming" &amp; VbCrLf &amp; "files, please wait..."
  </code></pre>
  
  <p>to this:</p>
  
  <pre><code>msgText = "Some text about copying and renaming" &amp; "files, please wait..."
  </code></pre>
  
  <p>Removal of VbCrLf seems to fix that error, just no line break is obviously happening. I can't figure out why it's behaving like that, what am I doing wrong. Every kind of insight on the problem would be much appreciated.</p>
  
  <p>Thank you in advance. :)</p>