
Originally Posted by
broecher
thanks for steering me in the right direction. It looks like what I want to do could be done without the text file possibly??? If I just had a module with a line that looks something like this:
shell "cmd.exe /C myprogram.py c:/path/f1.csv", vbNormalNoFocus
I can't test anything until I go to work tomorrow...
I don't remember finding anything that ever worked with more than one command line in DOS. There is a bunch of code out there to open DOS and run one line, but that's very limited. As an alternative though (if you have more than one line to run), you could stream a txt and rename it as a batch file, then shell it...?
Code:
Dim fs, oFile
Set fs = CreateObject("Scripting.FileSystemObject")
Set oFile = fs.createtextfile("c:\txtCommandLines.txt", True)
oFile.writeline "dir" 'what do we have in this dir?
oFile.writeline "chdir.." 'lets go back
oFile.writeline "dir" 'whats in this one?
oFile.Close
Name "c:\txtCommandLines.txt" As "c:\txtCommandLines.bat"
shell("c:\txtCommandLines.bat", vbHide)
Set fs = Nothing
Set oFile = Nothing
that's the only way I can see that you can execute multiple cmd's in the prompt. there just isn't any examples out there.