Howdy folks.
I wonder if someone would be kind enough to help me with a command line problem?
I wish to open a cmd window and send multiple commands to it, and then close when done. So far I can only work out how to open a window and send one command and then either have it automatically close or stay open. 
(Problem 1) How to send additional commands to a previously opened window?
(Problem 2) How to manually close the window when I'm done with it.
Sample code so far:-
Sub Upload_Firmware_File()
Dim Programmer_Name, Device_Name, FlashUploadFileandPath, EEPROMUploadFileandPath As String
'Set Programmer Type
Programmer_Name = "avrispv2"
'Set Target Device
Device_Name = "ATTINY26"
'Set File to be Uploaded
UploadFileandPath = "Q:\Firmware\Somefirmware.hex"
'Execute Flash Upload ( /k switch leaves cmd window open after completion.)
Call Shell("cmd.exe /k avrdude -c" & Programmer_Name & " -p " & Device_Name & " -U flash:w:" & FlashUploadFileandPath, vbNormalFocus)
'Execute EEPROM Upload
'TBA
'Execute Fuses Upload
'TBA
'Close CMD window
'TBA
End Sub
Background:- The code will be used in an electronics manufacturing site to run a command line IC programmer. The intent is to open the cmd window , execute initial flash upload, then EEPROM upload and then fuse upload and finally close the cmd window. It could be done by allowing the window to close after each command and then opening another one for each new operation but that's a bit messy.
Any help would be gratefully received.
Cheers,
Owen.
Bookmarks