home *** CD-ROM | disk | FTP | other *** search
/ Mega Top 1 / os2_top1.zip / os2_top1 / APPS / PROG / C_PLUS / CNVLIB2 / DOSSLAVE.BAT < prev    next >
Encoding:
DOS Batch File  |  1994-08-02  |  1.9 KB  |  61 lines

  1. @echo OFF
  2. ::***********************************************************************
  3. ::*** DOSSLAVE.BAT - DOS utility to work with the CEnvi DOS Slave     ***
  4. ::*** ver.2          utility to run OS/2 commands from a DOS session. ***
  5. ::***                This utility is supplanted by the newer OS2.BAT  ***
  6. ::***********************************************************************
  7.  
  8. IF "%1"=="" GOTO INSTRUCTIONS
  9. IF "%1"=="/?" GOTO INSTRUCTIONS
  10. GOTO HAVE_PARMS
  11.  
  12. :INSTRUCTIONS
  13. ECHO  
  14. ECHO DOSSLAVE.BAT - EXECUTE OS/2 COMMAND FROM A DOS SESSION
  15. ECHO  
  16. ECHO SYNTAX: DOSSLAVE [SEE] Command [parameters]
  17. ECHO  
  18. ECHO Where:
  19. ECHO   SEE - Wait for command to finish, and "SEE" OS/2 output on this screen
  20. ECHO   Command - Any OS/2 session command
  21. ECHO   parameters - Parameters to pass to the OS/2 command
  22. ECHO  
  23. ECHO Examples: DOSSLAVE START E C:\autoexec.bat
  24. ECHO           DOSSLAVE SEE chkdsk c:
  25. ECHO  
  26. ECHO NOTE: DOSSLAVE.CMD must be running to use DOSSLAVE.BAT
  27. ECHO       See newer OS2.BAT in CEnvi for DOS for better version.
  28. ECHO  
  29. GOTO OS2BAT_FINI
  30.  
  31. :HAVE_PARMS
  32. : Turn off undelete so it won't screw with temporary files
  33. SET OS2BAT_DEL_DIR=%DELDIR%
  34. SET DELDIR=
  35. IF EXIST %TEMP%\OS2_TODO.OUT del %TEMP%\OS2_TODO.OUT
  36. SET DELDIR=%OS2BAT_DEL_DIR%
  37. SET OS2BAT_DEL_DIR=
  38.  
  39. : Save to command file the current directory and the command to execute
  40. cd > %TEMP%\OS2_TODO.IN
  41. echo %1 %2 %3 %4 %5 %6 %7 %8 %9>> %TEMP%\OS2_TODO.IN
  42.  
  43. : Tell DOSSLAVE what file the command is in
  44. ECHO %TEMP%\OS2_TODO.IN> \PIPE\DOSSLAVE.IN
  45.  
  46. : Wait for the input file to not be there anymore
  47. :WAIT_FOR_RESULT
  48. IF EXIST %TEMP%\OS2_TODO.IN GOTO WAIT_FOR_RESULT
  49.  
  50. : Type out the result of the OS2 output file
  51. IF EXIST %TEMP%\OS2_TODO.OUT TYPE %TEMP%\OS2_TODO.OUT
  52.  
  53. : Delete the output file, no longer needed
  54. SET OS2BAT_DEL_DIR=%DELDIR%
  55. SET DELDIR=
  56. IF EXIST %TEMP%\OS2_TODO.OUT del %TEMP%\OS2_TODO.OUT
  57. SET DELDIR=%OS2BAT_DEL_DIR%
  58. SET OS2BAT_DEL_DIR=
  59.  
  60. :OS2BAT_FINI
  61.