• 1 reply
  • Latest Post - ‏2013-02-01T15:44:10Z by llandale
8 Posts

Pinned topic Run DOS .bat file from DXL

‏2013-01-31T22:05:24Z |
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
    648 Posts

    Re: Run DOS .bat file from DXL

    Here is some code to get you going.

    string     c_ComSpec       = getenv(
    // 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)