Pinned topic Run DOS .bat file from DXL
Answered question This question has been answered.
Unanswered question This question has not been answered yet.
How do you call File.bat <arg1>, <arg2> from DXL?
Updated on 2013-02-01T15:44:10Z at 2013-02-01T15:44:10Z by llandale
llandale 270001QM9N643 Posts
Re: Run DOS .bat file from DXL2013-02-01T15:44:10ZThis is the accepted answer. This is the accepted answer.Here is some code to get you going.
string c_ComSpec = getenv( "COMSPEC") // looks like "c:\Windows\cmd.exe" string SysCommand = c_ComSpec " /c " FcCommand // print "\t>>applyFC: B4 system, SysCommand: [" SysCommand "]\n" //  Send to system, wait to finish, display results: system(SysCommand) // Run the command; black window should blink to user infoBox(c_Version ":\nWait for black Command-Prompt window to close...") system( "Notepad.exe " in_NameReport "") // Open the report
That "system" command initiates the batch file and returns to the DXL; thus that hokey "infoBox" forcing DXL to wait. This command instead will wait for it to completely finish, but while most other folks get it to work it will not work on my computers.
int win32SystemWait_(string commandString,string& sResult, int waitTime)