Well, there is probably your problem:

You will probably need to add a space after the /c and another before the Dir
vb Code:
  1. CMDLINE = "cmd.exe /c " & Text2.Text
  2. Shell CMDLINE
  3. CMDLINE = "Dir /b >> dir.txt"
  4. Shell CMDLINE