home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
OS/2 Professional
/
OS2PRO194.ISO
/
os2
/
prgramer
/
cenvi
/
os2.bat
< prev
next >
Wrap
DOS Batch File
|
1994-03-08
|
2KB
|
59 lines
@echo OFF
::******************************************************************
::*** OS2.BAT - DOS utility to work with the CEnvi DOS Slave ***
::*** ver.1 utility to run OS/2 commands from a DOS session. ***
::******************************************************************
IF "%1"=="" GOTO INSTRUCTIONS
IF "%1"=="/?" GOTO INSTRUCTIONS
GOTO HAVE_PARMS
:INSTRUCTIONS
ECHO
ECHO OS2.BAT - EXECUTE OS/2 COMMAND FROM A DOS SESSION
ECHO
ECHO SYNTAX: OS2 [SEE] Command [parameters]
ECHO
ECHO Where:
ECHO SEE - Wait for command to finish, and "SEE" OS/2 output on this screen
ECHO Command - Any OS/2 session command
ECHO parameters - Parameters to pass to the OS/2 command
ECHO
ECHO Examples: OS2 START E C:\autoexec.bat
ECHO OS2 SEE chkdsk c:
ECHO
ECHO NOTE: DOSSLAVE.CMD must be running to use OS2.BAT
ECHO
GOTO OS2BAT_FINI
:HAVE_PARMS
: Turn off undelete so it won't screw with temporary files
SET OS2BAT_DEL_DIR=%DELDIR%
SET DELDIR=
IF EXIST %TEMP%\OS2_TODO.OUT del %TEMP%\OS2_TODO.OUT
SET DELDIR=%OS2BAT_DEL_DIR%
SET OS2BAT_DEL_DIR=
: Save to command file the current directory and the command to execute
cd > %TEMP%\OS2_TODO.IN
echo %1 %2 %3 %4 %5 %6 %7 %8 %9>> %TEMP%\OS2_TODO.IN
: Tell DOSSLAVE what file the command is in
ECHO %TEMP%\OS2_TODO.IN> \PIPE\DOSSLAVE.IN
: Wait for the input file to not be there anymore
:WAIT_FOR_RESULT
IF EXIST %TEMP%\OS2_TODO.IN GOTO WAIT_FOR_RESULT
: Type out the result of the OS2 output file
IF EXIST %TEMP%\OS2_TODO.OUT TYPE %TEMP%\OS2_TODO.OUT
: Delete the output file, no longer needed
SET OS2BAT_DEL_DIR=%DELDIR%
SET DELDIR=
IF EXIST %TEMP%\OS2_TODO.OUT del %TEMP%\OS2_TODO.OUT
SET DELDIR=%OS2BAT_DEL_DIR%
SET OS2BAT_DEL_DIR=
:OS2BAT_FINI