In order to invoke a Windows shell function (such as a batch file or executable) from APPX for Windows, you can use a syntax similar to the following. (You'll have to break the SET statement apart into multiple APPENDs, but it is presented here as single strings, for clarity.)
Windows NT, APPX 4.0.2 and after:SET --- TEMP 132 = cmd.exe /c C:\APPX\scripts\test.bat RUN --- TEMP 132Windows 9x, APPX 4.0.2 and after:
SET --- TEMP 132 = C:\command.com /c C:\APPX\scripts\test.bat RUN --- TEMP 132Windows NT, prior to APPX 4.0.2:
SET --- TEMP 132 = cmd.exe /c C:\\APPX\\scripts\\test.bat RUN --- TEMP 132Windows 9x, prior to APPX 4.0.2:
SET --- TEMP 132 = C:\\command.com /c C:\\APPX\\scripts\\test.bat RUN --- TEMP 132In the above example, "test.bat" contains some DOS copy commands. DOS commands (such as 'copy') don't work directly from APPX, because we are using a Windows "exec" function, which only knows how to start Windows programs. But running command.com from Windows, with the "/c" switch, creates a temporary DOS shell, which can then execute a DOS batch file. The "/c" after cmd.exe and command.com specifies that the command interpreter is to perform the command specified by the string following it, in this case a batch file, and then stop. Note that you can use option 6)Upper/Lower in the ILF editor to get lower case characters, such as 'cmd.exe'. In releases 4.0.1 and prior, the double backslashes ("\\") are necessary to pass a single backslash ("\") thru to the windows shell, since backslash is used in DOS to denote special treatment of the following character. In release 4.0.2 and after, the double backslash is no longer required. Running command.com /c or cmd.exe /c is only necessary when invoking non-Windows native applications. This includes commands one would normally execute from the DOS popup box. If you want to run a Windows-native application (such as notepad, or MS Access), you can invoke this directly without the command.com or cmd.exe /c prefix. Without a preceding backslash, a "$" is an indicator of a substitution in the RUN command string based on a PASS statement. A backslash preceding a "$" tells APPX not to do a substitution but to allow the "$" to remain in the RUN command string. (And the '%' symbol?)
echo - display statement in the DOS box. copy - execute statement and display in DOS box. pause - display "Press any key to continue" and wait for user to press enter before proceeding. choice - display the message, waited for user to make a valid selectionTo accomplish this, make a copy of COMMAND.COM and put it into a test directory. In the PROGRAM tab of PROPERTIES for this new file, deselect the "Close on Exit" check box. Then modify the APPX subroutine to invoke this test copy of COMMAND.COM. Now everything should continue to work fine and the box remain on screen. The title bar should at the end say: "Finished - " when complete.
====================== ===== ======================================= 013 REMOVE DIRECTO+------------------------------------------------+ 014 SUBMIT JOB & Command String & 015 GET SESSION PI& & 016 KILL TASK &cat6 & 017 VIEW FILE &{PRINTQ.HEX OPTIONS}6 & XX8 SUBMIT PRINT J&{BANNER FILE}6 & &{PRINTQ.PATH FILE}6 & &|lp -oraw6 & &{PRINTQ.SUBMIT DETAIL}6 & &2>&1 |awk '/^request id is/{print "0" \$4}6 & &/^\\/usr\\/bin\\/lp/{print "1" \$0}' & & & & & +------------------------------------------------+After:
000 GET HOST NAME +------------------------------------------------+ 001 CANCEL PRINT J& Command String & 002 GET PROCESS ID& & 003 COPY A FILE &cat6 & 004 REMOVE FILE &{PRINTQ.HEX OPTIONS}6 & 005 GET GROUP LIST&{BANNER FILE}6 & 005 START BACKGROU&{PRINTQ.PATH FILE}6 & 006 LOOK FOR PRINT&|lp -oraw6 & 007 GET SYSTEM PRI&{PRINTQ.SUBMIT DETAIL}6 & 008 SUBMIT PRINT J&2>&1 |awk '/^request id is/{print "0" \$4}6 & 009 GET DIRECTORY &/^\/usr\/bin\/lp/{print "1" \$0}' & 010 GET NAME FROM & & 011 GET SYSTEM JOB& & 012 RENAME A FILE +------------------------------------------------+