home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
OS/2 Shareware BBS: 18 REXX
/
18-REXX.zip
/
WINAPP.ZIP
/
WINAPP.CMD
< prev
next >
Wrap
OS/2 REXX Batch file
|
1993-02-02
|
8KB
|
194 lines
/* Program: WINAPP.CMD */
/* */
/* Purpose */
/* PUBLIC APPLICATIONS - OS/2 LAN SERVER 2.0 */
/* This REXX Program allows you to do a coupe of things: */
/* 1) Serve Public Applications with customized DOS or WIN-OS/2 settings */
/* 2) Disconnect the network drive after the user exits the application. */
/* */
/* In large installations, you may have 30 licenses for an application */
/* and 120 people that want to use it occasionally. */
/* Setting Maximum number of users for the alias to 30, the first 30 */
/* users who access the application will tie up the licenses until */
/* they log off the LAN. */
/* This method solves that problem by dynamically connecting */
/* to the network drive when the user picks the Public Application */
/* and then disconnecting the drive when they exit the application, */
/* thus freeing up the license count as soon as they are done */
/* */
/* Assumptions: The following programs must be under the network alias */
/* directory: */
/* SLEEPER.EXE */
/* WINAPP2.CMD */
/* */
/* * The argument NetDrive is passed to this command procedure */
/* specifying the network drive letter you wish to use. */
/* For Example: WINAPP.CMD S: */
/* On the COMMAND LINE field in OS/2 Lan Server */
/* * Set up the application as a Public OS/2 Application */
/* in Lan Server. */
/* */
/* Revision History: */
/* Date Analyst Version Comments */
/* -------- ------- ------- -------------- */
/* 12/08/92 D. Campbell 1.0 Original */
/* */
/* */
/* */
/* */
/* Load REXX utility functions */
call rxfuncadd sysloadfuncs, rexxutil, sysloadfuncs
call sysloadfuncs
arg NetDrive
'@ECHO OFF'
Say 'Running Excel 4.0...'
/* substitute the name of your file alias were WINXL40 is below */
'NET USE' NetDrive 'WINXL40 > NUL'
if rc \= 0 then SIGNAL Error
/* See if the application data directory exists on the requester */
rc = SysFileTree('C:\EXCEL',file_list,'D')
If file_list.0 = 0 Then
Do
'C:'
Call SysMkDir 'C:\EXCEL'
End
/* Run Excel 4.0 */
/* Log to the network drive that contains the application */
NetDrive
/* Define elements of the program object */
/* Refer to Mike Lamb's CRTOBJ.TXT for full description of all these */
/* settings */
classname='WPProgram'
title='Excel 4.0'
location='<WP_NOWHERE>' /* place in invisible folder */
program='EXENAME='NetDrive'\EXCEL.EXE;PARAMETERS=-P C:\EXCEL;'
type='PROGTYPE=WIN;MAXIMIZED=YES;' /* type of session (WIN-OS/2) */
startup='STARTUPDIR='NetDrive';' /* startup directory */
settings='SET DPMI_MEMORY_LIMIT=4;' /* required DOS settings */
open='OPEN=DEFAULT;' /* open now */
call SysCreateObject classname, title, location,,
program||type||startup||settings||open, 'REPLACE'
/* If SLEEPER.EXE and WINAPP2.CMD do not exist on the users */
/* workstation, copy them */
rc = SysFileTree('c:\os2\system\sleeper.exe',file_list,'B')
If file_list.0 = 0 Then
Do
'copy 'NetDrive'\sleeper.exe c:\os2\system'
End
rc = SysFileTree('c:\os2\system\winapp2.cmd',file_list,'B')
If file_list.0 = 0 Then
Do
'copy 'NetDrive'\winapp2.cmd c:\os2\system'
End
/* Detach a process that tries to delete the network connection every */
/* 25 seconds. It will fail as long as the application is being used. */
/* Once the user exits the app, the drive will be deleted successfully */
/* This idea was compilments of Tom Myers - IBM */
'detach c:\os2\system\winapp2.cmd 'NetDrive
Exit
Error:
Say ' '
Say "Couldn't access Excel 4.0 on the server!"
'PAUSE'
Exit
/* The text below is from Mike Lamb's CRTOBJ.TXT */
**********************************
***WPProgram setup string parms***
**********************************
KEYNAME VALUE Description
-----------------------------------------------------------------------------
<<Program>>
EXENAME filename Sets the name of the program
PARAMETERS params Sets the parameters list, which may
include substitution characters
STARTUPDIR pathname Sets the working directory
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
<<Sessions>>
PROGTYPE FULLSCREEN Sets the session type to OS/2 full screen
PM Sets the session type to PM
SEPARATEWIN Sets the session type to WIN-OS2 window
running in a separate VDM.
VDM Sets the session type to DOS full screen
WIN Sets the session type to WIN-OS2 full screen
WINDOWABLEVIO Sets the session type to OS/2 windowed
WINDOWEDVDM Sets the session type to DOS windowed
WINDOWEDWIN Sets the session type to WIN-OS2 windowed
MINIMIZED YES Start program minimized
MAXIMIZED YES Start program maximized
NOAUTOCLOSE YES Leaves the window open upon program termination.
NO Closes the window when the program terminates.
-DOS Settings-
NOTES:
- To change these values you use SET keyname=
Example: SET DOS_FILES=45;SET DOS_HIGH=1
Also for some use values of 1 for ON, 0 for off
Example: SET COM_HOLD=1; (on, default is off)
To add more than one DOS_DEVICE you need to separate with hex 0A (line-feed)
Rexx example:
h0A='0A'X
setup='...;SET DOS_DEVICE=C:\OS2\MDOS\ANSI.SYS'h0A'C:\OS2\MDOS\EGA.SYS...'
List of DOS Setting fields
COM_HOLD
DOS_BACKGROUND_EXECUTION
DOS_BREAK
DOS_DEVICE
DOS_FCBS
DOS_FCBS_KEEP
DOS_FILES
DOS_HIGH
DOS_LASTDRIVE
DOS_RMSIZE
DOS_SHELL
DOS_STARTUP_DRIVE
DOS_UMB
DOS_VERSION
DPMI_DOS_API
DPMI_MEMORY_LIMIT
DPMI_NETWORK_BUFF_SIZE
DPMI_DOS_API
EMS_FRAME_LOCATION
EMS_HIGH_OS_MAP_REGION
EMS_LOW_OS_MAP_REGION
EMS_MEMORY_LIMIT
HW_NOSOUND
HW_ROM_TO_RAM
HW_TIMER
IDLE_SECONDS
IDLE_SENSITIVITY
KBD_ALTHOME_BYPASS
KBD_BUFFER_EXTEND
KBD_RATE_LOCK
MEM_INCLUDE_REGIONS
MEM_EXCLUDE_REGIONS
MOUSE_EXCLUSIVE_ACCESS
PRINT_TIMEOUT
VIDEO_FASTPASTE
VIDEO_MODE_RESTRICTION
VIDEO_ONDEMAND_MEMORY
VIDEO_RETRACE_EMULATION
VIDEO_ROM_EMULATION
VIDEO_SWITCH_NOTIFICATION
VIDEO_WINDOW_REFRESH
VIDEO_8514A_XGA_IOTRAP
XMS_HANDLES
XMS_MEMORY_LIMIT
XMS_MINIMUM_HMA