I think this should be a simple mistake but I can't figure out where I'm going wrong. Thanks in advance for any suggestions.

I'm having a problem using the Shell() function in my VB.NET code. I had it working a couple of months ago and went back to add some comments to my code, recompiled, and now it get the following error:

Unhandled Exception: System.IO.FileNotFoundException: File not found.
at Microsoft.VisualBasic.Interaction.Shell(String Pathname, AppWinStyle Style, Boolean Wait, Int32 Timeout)
at RunFileProcessing.RunFileProcessing.Main()
My code is this:

VB Code:
  1. Shell("dir")
  2. '  -or-
  3. Microsoft.VisualBasic.Interaction.Shell("dir")
  4.  
  5. 'Shell("C:\Autosys45\Utilities\cawto.bat" & """" & OutputMessage & """")
  6. '  -or-
  7. 'Microsoft.VisualBasic.Interaction.Shell("C:\Autosys45\Utilities\cawto.bat" & """" & OutputMessage & """")

I'm trying to call the .bat file listed but I get the error above. But if I change it to just do a simple "dir" I still get the same error. I've made sure I added a reference to Microsoft.VisualBasic.Vsa and I've tried using the following Imports at the top of the vb:

VB Code:
  1. Imports Microsoft.VisualBasic
  2. '  -or-
  3. Imports Microsoft.VisualBasic.Interaction

My program throws the error no matter what I do unless I just comment out the lines where I use "Shell". Does anyone have any idea what I could be doing wrong? Is there another way to execute a batch file in VB.NET???