Wednesday, March 7, 2012

does anyone know how to run a batch file using vb script?

This is not working.

Set oShell = CreateObject("WScript.Shell")
oShell.Exec "test.bat"

Try the "call" command. it works in similar scenarios. I have not tested it in vb script from SSIS but it should work just fine.

Here is the modified command:

Set oShell = CreateObject("WScript.Shell")
oShell.Exec "call test.bat"

Thanks,
Greg Van Mullem|||That doesn't seem to work. The error is can't find specified file.|||

Try Run instead of Exec.

Set oShell = CreateObject("WScript.Shell")
oShell.Run "test.bat"

|||call shell(c:\test.bat)

No comments:

Post a Comment