Other Languages - .bat files - Asked By Henry Taylor on 11-May-12 11:34 AM

I have a .bat file that is supposed to start a console exe created with vb.net vs2010. The .bat file starts and issues the command and my console window opens but the program does not run.

I have Console.Writeline() statements in the program that display progress as the program executes but I don't see any of that information being generated. The program runs fine from the IDE but when attempting to run it from the .bat file it just doesn't run. Arggggg!

When I try to run the exe from the .bat file I see:


WRONG!


When I run the program from the IDE I see something like this:


RIGHT! :)

This is maddening!  Any help?

Thanks.

Henry






[)ia6l0 iii replied to Henry Taylor on 11-May-12 12:23 PM
What is in the .bat file?
Robbe Morris replied to Henry Taylor on 11-May-12 03:46 PM
Make sure you put the full path to the exe in your .bat file
Henry Taylor replied to Henry Taylor on 04-Jun-12 09:28 AM
The way to do this is to forget about .bat files and go with PowerShell:

#If your scripts don't run execute the command below:
#Set-ExecutionPolicy RemoteSigned

cd "c:\Program Files\XCorp\Scheduler"

$runDate = Get-Date "5/18/2012"
$batchList = (290,310,320,340,380)
$BPScriptor = "BatchProcessScriptor.exe"

foreach ($batch in $batchList)
{     
    start-process $BPScriptor $batch, $runDate -wait
}