* STOREMAP.EXE Version 1.1
* by Nick J. Pezirtzoglou
*
*
* There is no warranty to the performance of this package to any
* particular application.  It has been tested and found to work
* if run as outlined in this document.
*
* This program is freeware so if you find it useful use it!

STOREMAP allows you to take a snapshot of all network drives and 
search mappings before executing an application which drastically
changes these mappings.  Running STOREMAP creates a batch file 
which when run will recreate a user's environment including search 
mappings.

There are two fundamental things you need to consider before running
STOREMAP.

1.      You must create a DOS variable called USERNAME to store the user's
        login name.  You can do this in the system login script by 
        specifying:

        DOS SET USERNAME="%login_name"


2.      You must create a directory STOREMAP on a server.
        
        This directory should contain Novell's MAP command neccessary for
        re-establishing the user's environment.  

        Note:   Make sure you add this directory in the trustee directory
                assignment for the group EVERYONE or applicable group for
                your site.  The rights necessary are Create, Modify, Read,
                Write, Delete, and File Scan.


At this point you are ready to run STOREMAP. 

To run STOREMAP type:  STOREMAP {drive}

{drive} will specify the drive on which STOREMAP can locate the directory
STOREMAP.  (i.e. STOREMAP F:)


When the program is run for a user SMITH it will create a batch file 
called SMITH.BAT in the STOREMAP directory. You may at this point 
change any mapping on the server(s) and run any application. 

Note:   Do not remap the drive specified as the {drive} parameter on 
        STOREMAP.  This drive is essential to re-establishing the 
        user's environment.


When you have finished with your application you can run the batch file
created for the user and their environment will be re-established.


=============================================================================
Below is a sample batch file created by running STOREMAP G:
=============================================================================

@ECHO OFF
rem ***** Batch Filename: PEZIRTZS.BAT
rem *****    Description: This batch file has been created by STOREMAP.EXE Version 1.1
rem *****                 to restore user's PEZIRTZS environment.
rem *****   Created Date: 7/7/1994

SET PATH=
if exist F:\nul G:\STOREMAP\MAP DEL F: >nul
if exist H:\nul G:\STOREMAP\MAP DEL H: >nul
if exist I:\nul G:\STOREMAP\MAP DEL I: >nul
if exist J:\nul G:\STOREMAP\MAP DEL J: >nul
if exist K:\nul G:\STOREMAP\MAP DEL K: >nul
if exist L:\nul G:\STOREMAP\MAP DEL L: >nul
if exist M:\nul G:\STOREMAP\MAP DEL M: >nul
if exist N:\nul G:\STOREMAP\MAP DEL N: >nul
if exist O:\nul G:\STOREMAP\MAP DEL O: >nul
if exist P:\nul G:\STOREMAP\MAP DEL P: >nul
if exist Q:\nul G:\STOREMAP\MAP DEL Q: >nul
if exist R:\nul G:\STOREMAP\MAP DEL R: >nul
if exist S:\nul G:\STOREMAP\MAP DEL S: >nul
if exist T:\nul G:\STOREMAP\MAP DEL T: >nul
if exist U:\nul G:\STOREMAP\MAP DEL U: >nul
if exist V:\nul G:\STOREMAP\MAP DEL V: >nul
if exist W:\nul G:\STOREMAP\MAP DEL W: >nul
if exist X:\nul G:\STOREMAP\MAP DEL X: >nul
if exist Y:\nul G:\STOREMAP\MAP DEL Y: >nul
if exist Z:\nul G:\STOREMAP\MAP DEL Z: >nul
G:\STOREMAP\MAP INS S1:=OPI02/SYS:PUBLIC >NUL
G:\STOREMAP\MAP INS S2:=OPI02/SYS:PUBLIC\OPI_PC\MSDOS\V6.20 >NUL
G:\STOREMAP\MAP INS S3:=OPI02/SYS:APPS\SABER >NUL
G:\STOREMAP\MAP INS S4:=OPI02/VOL1:USERS\PEZIRTZS >NUL
G:\STOREMAP\MAP INS S5:=OPI02/SYS:PUBLIC\BATCH >NUL
G:\STOREMAP\MAP INS S6:=D:\SYS\DOS >NUL
G:\STOREMAP\MAP INS S7:=C:\APPS\BORLANDC\BIN >NUL
G:\STOREMAP\MAP T:=OPI07/SYS:DEPT >NUL
G:\STOREMAP\MAP S:=OPI03/SYS: >NUL
G:\STOREMAP\MAP R:=OPI07/VOL1: >NUL
G:\STOREMAP\MAP Q:=OPI04/SYS: >NUL
G:\STOREMAP\MAP P:=OPI03/VOL1: >NUL
G:\STOREMAP\MAP O:=OPI01/VOL2: >NUL
G:\STOREMAP\MAP N:=OPI01/SYS: >NUL
G:\STOREMAP\MAP L:=OPI03/VOL2: >NUL
G:\STOREMAP\MAP K:=OPI02/VOL1:USERS\COMMON >NUL
G:\STOREMAP\MAP J:=OPI02/VOL1:USERS\PEZIRTZS >NUL
G:\STOREMAP\MAP I:=OPI07/SYS: >NUL
G:\STOREMAP\MAP F:=OPI02/SYS: >NUL
G:


============================================================================
A sample batch file used on our site to launch Windows demonstrates the use
of STOREMAP
============================================================================

@ECHO OFF
REM ****   BATCH NAME: WIN_NASI.BAT
REM ****  DESCRIPTION: THIS BATCH FILE IS CALLED FROM THE LOGIN SCRIPT
REM ****               TO MAP OUT THE NECESSARY DRIVES TO LAUNCH THE   
REM ****               NETWORKED WINDOWS SYSTEM & MODEM POOLING.
REM ****   CREATED BY: NICK J. PEZIRTZOGLOU
REM **** CREATED DATE: MARCH 17, 1994
REM
REM
REM **** The Variables Listed Below MUST be assigned due to a Windows
REM **** Limitation which does not enable us to expand the DOS Environment
REM **** after Windows has launched.  By defining these variables here
REM **** we will be able to "re-cycle" the DOS environment within the 
REM **** Windows environment.
REM
REM **** The following Environment Expansion variables will allow us 
REM **** to use 1200 bytes of environment space within Windows.
SET ENV_EXP1=AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
SET ENV_EXP2=AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
SET ENV_EXP3=AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
SET ENV_EXP4=AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
SET ENV_EXP5=AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA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AN.EXE SET LOC_WIN=TRUE

:NASI
        rem goto NO_NASI
        NASI /N="%USERNAME%" /P="" /S="%USERNAME%" /V=1 
        NINT14 /I
        goto PRMPT

:NO_NASI        
        CLS
        ECHO *********************************************************************
        ECHO **** Modem Services are shutdown for Tuesday May 31, 1994.       ****
        ECHO **** This service will be back online later today. Nick P.       ****
        ECHO *********************************************************************
        pause


:PRMPT
        if %LOC_WIN%==TRUE goto PRMPT2
        goto MAP_NET

:PRMPT2    
        set LOC_WIN=FALSE
        cls
        ECHO Do you wish to run Windows Locally ?
        yesno
        if errorlevel 1 SET LOC_WIN=TRUE

:MAP_NET        
        STOREMAP G:
        MAP DEL S3:>nul
        IF EXIST Q:\ MAP DEL Q:>nul
        IF EXIST G:\ MAP DEL G:>nul
        IF EXIST H:\ MAP DEL H:>nul
        IF EXIST I:\ MAP DEL I:>nul
        MAP ROOT Q:=OPI02\VOL1:USERS\%USERNAME%\WINDOWS>nul
        MAP ROOT G:=OPI02\SYS:WINDOWS\NETTOOLS>nul
        MAP H:=OPI02\SYS:>nul
        MAP ROOT I:=OPI02\SYS:MAILDATA>nul
        MAP INS S3:=OPI02\SYS:WINDOWS\NETTOOLS>nul
        if %LOC_WIN%==TRUE goto INS_LOC
        goto INS_NET
        :INS_LOC
                if exist C:\SYS\WINDOWS\PROGMAN.EXE MAP INS S4:=C:\SYS\WINDOWS>nul
                if exist C:\WINDOWS\PROGMAN.EXE MAP INS S4:=C:\WINDOWS>nul
                rem if exist D:\SYS\WINDOWS\PROGMAN.EXE MAP INS S4:=D:\SYS\WINDOWS>nul
                rem if exist D:\WINDOWS\PROGMAN.EXE MAP INS S4:=D:\WINDOWS>nul
        :INS_NET
                MAP INS S4:=OPI02\SYS:WINDOWS>nul
        :INS_END
        CLS
        REM CALL U:\APPS\REACHNET\WINLDN.BAT
        CALL U:\APPS\REACHOUT\WINLDM.BAT
        if %LOC_WIN%==FALSE Q:
        U:\WINDOWS\NETTOOLS\WWTSR
        WIN 
        U:\WINDOWS\NETTOOLS\WWTSR UNLOAD
        CALL U:\APPS\REACHOUT\WINUNLDM.BAT
        REM CALL U:\APPS\REACHNET\WINUNLDN.BAT
        MAP DEL S3:>nul
        MAP DEL S3:>nul
        MAP DEL S3:>nul
        MAP DEL G:>nul
        MAP DEL H:>nul
        MAP DEL I:>nul
        SET RCHPATH=
        SET TEMP=%WINTEMP%
        SET WINTEMP=
        MAP G:=OPI02\SYS:>nul
        MAP Q:=OPI02\VOL1:>nul
        NINT14 /U
        NASI /U
        if %NOLOGOUT%==YES goto REMAP
        G:\LOGIN\SHUTDOWN.BAT
:REMAP
        CLS
        ECHO ***** PLEASE WAIT RE-ESTABLISHING ENVIRONMENT ****
        ECHO ***** To Re-Run Windows type WIN_NET          ****
        SET ENV_EXP1=
        SET ENV_EXP2=
        SET ENV_EXP3=
        SET ENV_EXP4=
        SET ENV_EXP5=
        SET ENV_EXP6=
        SET ENV_EXP7=
        SET ENV_EXP8=
        SET ENV_EXP9=
        SET ENV_EXPA=
        SET ENV_EXPB=
        SET ENV_EXPC=
        SET LOC_WIN=
        SET WINTEMP=

        MAP G:=OPI02\SYS: > NUL
        G:\STOREMAP\%USERNAME%.BAT
:END

