The Following VBscript checks for the existence of the Temp Folder, Creates
it where specified in the Startup file, or displays an error if it doesn't
exist in the Startup file.  I have a more elaborate one that I run on
Database Startup that makes sure all files necessary to run the applications
and their folders(if required) are present. If they are not, they are
recreated from storage in the Database....

Mike


Dim Wss
Dim Env
Dim FSO

Set Wss = CreateObject("WScript.Shell")
Set Env = Wss.Environment("PROCESS")
Set FSO = CreateObject("Scripting.FileSystemObject")

Main

Sub Main
  TmpDir = Env("TEMP")
  If TmpDir = "" Then
    MsgBox "ENVIRONMENT ''TEMP'' IS MISSING FROM WINDOWS" & vbcrlf & _
           "STARTUP FILES. YOUR PROGRAMS AND WINDOWS" & vbcrlf & _
           "WILL NOT WORK PROPERLY UNTIL THIS PROBLEM" & vbcrlf & _
           "HAS BEEN FIXED. IF YOU DO NOT KNOW HOW TO" & vbcrlf & _
           "CORRECT THIS, CONTACT SYS ADMINISTRATOR", VbOnOnly, "CRITICAL
ERROR"
  CallItQuits(1)
  End if
  With Fso
    If .FolderExists(TmpDir) <> True Then
      .CreateFolder TmpDir
      If Err.Number <> 0 Then
            msg = "The Operating System Temporary Folder:" & vbCrLf
        msg = msg & UCase(TmpDir) & vbCrLf
        msg = msg & "Was Not Found At The Specified Location" & vbCrLf
        msg = msg & "On The System.  An Attempt To Create It" & vbCrLf
        msg = msg & "Was Unsuccessful.  You Should Try To" & vbCrLf
        msg = msg & "Create It Yourself At The Location Shown" & vbCrLf
        msg = msg & "If You Know How. Windows And RBase Will" & vbCrLf
        msg = msg & "Not Function Properly Until This Is Done." & vbCrLf
        msg = msg & "If You Do Not Know How To Do This Properly," & vbCrLf
        msg = msg & "Do Not Attempt It.  Contact The Administrator" & vbCrLf
        MsgBox UCase(msg), vbOKOnly, "CRITICAL FOLDER MISSING"
        CallItQuits (1)
        Exit Sub
      End If
    End If
  End With
 End Sub

 Private Sub CallItQuits(iVal)
  If iVal <> 0 Then
    Set Fso = Nothing
    Set Wss = Nothing
    Set Env = Nothing
    Set FilOut = Nothing
    Set TSout = Nothing
    msgbox "Errors Occured In Script" & VbCrLf & _
           Err.Description, VbOkOnly, "Errors"
    WScript.Quit (iVal)
  Else
    Set Fso = Nothing
    Set Wss = Nothing
    Set Env = Nothing
    Set FilOut = Nothing
    Set TSout = Nothing
    WScript.Quit (0)
  End If
 End Sub



----- Original Message -----
From: "david blocker" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Wednesday, January 23, 2002 2:34 PM
Subject: Re: Running 6.1A DOS under Windows 98


> To all who offered ideas
>
> DUH DUH DUH
>
> says D. Blocker - I was SURE I had created the TEMP and TMP directories,
but
> when I checked to be sure - Nope, not there!! Once created, all is well.
>
> Thanks and I owe more to Project Bundleup!
>
> David
>
> ----- Original Message -----
> From: "Eric M. Bienstock, Ph.D." <[EMAIL PROTECTED]>
> To: <[EMAIL PROTECTED]>
> Sent: Tuesday, January 22, 2002 11:13 PM
> Subject: Re: Running 6.1A DOS under Windows 98
>
>
> > >> I get "Unable to create environment file." message...........
> > | <<There are a C:\TEMP and a C:\TMP and in AUTOEXEC.BAT, I have SET
TEMP
> =
> > | C:\TEMP and SET TMP = C:\TMP>>
> > ==================================
> >
> > David,
> >
> > To check that the TEMP and TMP settings are actually getting executed,
go
> to
> > the DOS prompt and enter the command SET.  Also, be sure it is indeed
> > C:\TEMP and not C:\Windows\TEMP (I've seen this mix-up happen before).
> >
>
> --------------------------------------------------------------------------
> -
> > Eric M. Bienstock, Ph.D.
> >    Database Development, etc.
> >       Authorized R:BASE Developer
> >          Eric M. Bienstock & Associates, Inc.
> >             day: 212-978-7948    eve:  973-763-8650(8)
> >                FAX:  209-882-9250    [EMAIL PROTECTED]
> >                    http://members.home.net/ericmb/Ericmb.htm
>
> --------------------------------------------------------------------------
> -
> >
> > ----- Original Message -----
> > From: "david blocker" <[EMAIL PROTECTED]>
> > To: <[EMAIL PROTECTED]>
> > Sent: Tuesday, January 22, 2002 10:26 PM
> > Subject: Re: Running 6.1A DOS under Windows 98
> >
> >
> > | Bernie
> > |
> > | <<There are a C:\TEMP and a C:\TMP and in AUTOEXEC.BAT, I have SET
TEMP
> =
> > | C:\TEMP and SET TMP = C:\TMP>>
> > |
> > | What's wrong with it?
> > |
> > | David
> > |
> > | ----- Original Message -----
> > | From: "Bernie Corrigan" <[EMAIL PROTECTED]>
> > | To: <[EMAIL PROTECTED]>
> > | Sent: Tuesday, January 22, 2002 5:12 PM
> > | Subject: Re: Running 6.1A DOS under Windows 98
> > |
> > |
> > | > David -
> > | >         I think that means that you don't have your temporary
> > directories,
> > | > temp and tmp, set up right.
> > | >
> > | > Bernie
> > | > =======================================
> > | > At 05:00 PM 1/22/2002 -0500, you wrote:
> > | > >Hi everyone
> > | > >
> > | > >I still have a few R:Base for DOS clients out there.  I recently
> bought
> > a
> > | > new hard drive for my portable Dell, running Windows 98.  I
carefully
> > set
> > | up
> > | > R:Base 6.1A for DOS EXACTLY as it is on my other machine, a WIndows
95
> > | > desktop, and cannot get it to run.  Everytime I try, I get "Unable
to
> > | create
> > | > environment file." message. It's been a long time since I did this,
> and
> > so
> > | > far tech support has been unable to see what's wrong. It's a
familiar
> > | error
> > | > message, somewhere in the dark recesses of my mind I remember a
simple
> > | fix,
> > | > but can't figure it out!
> > | > >
> > | > >Settings:
> > | > >
> > | > >Icon
> > | > >Properties:
> > | > >CMD line:  C:\WINDOWS\RB1A.BAT
> > | > >Working: C:\RBDOS61A
> > | > >Shortcut key: none
> > | > >Run: Normal Window or Maximized, neither work
> > | > >Close on Exit: yes
> > | > >
> > | > >Advanced Settings:Prevent MS DOS programs from detecting Windows
> > | > >
> > | > >MEMORY:
> > | > >
> > | > >Conventional Memory: Total 440
> > | > >Initial Environment: 4096
> > | > >
> > | > >Protected: yes
> > | > >
> > | > >Expanded memory: 1024
> > | > >Extended memory: None
> > | > >Uses HMA: Yes
> > | > >
> > | > >MS-DOS memory: 8192
> > | > >
> > | > >Since default paths are for R:Base 6.5 Windows, the batch file
resets
> > | path
> > | > for C:\RBDOS61A and C:\RBDOS61A\SERVER, runs RBASE and then resets
to
> > | > default paths
> > | > >
> > | > >There are a C:\TEMP and a C:\TMP and in AUTOEXEC.BAT, I have SET
TEMP
> =
> > | > C:\TEMP and SET TMP = C:\TMP.
> > | > >
> > | > >In CONFIG.SYS, FILES=60 and BUFFERS=60
> > | > >
> > | > >I get the same error whether I use the icon or go to DOS in
> C:\RBDOS61A
> > | and
> > | > type "RBASE"
> > | > >
> > | > >Any suggestions?
> > | > >
> > | > >David Blocker
> > | > >
> > | > ><!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
> > | > ><HTML><HEAD>
> > | > ><META http-equiv=Content-Type content="text/html;
> charset=iso-8859-1">
> > | > ><META content="MSHTML 5.50.4134.600" name=GENERATOR>
> > | > ><STYLE></STYLE>
> > | > ></HEAD>
> > | > ><BODY bgColor=#ffffff>
> > | > ><DIV><FONT face=Arial size=2>Hi everyone</FONT></DIV>
> > | > ><DIV><FONT face=Arial size=2></FONT>&nbsp;</DIV>
> > | > ><DIV><FONT face=Arial size=2>I still have a few R:Base for DOS
> clients
> > | out
> > | > >there.&nbsp; I recently bought a new hard drive for my portable
Dell,
> > | running
> > | > >Windows 98.&nbsp; I carefully set up R:Base 6.1A for DOS EXACTLY as
> it
> > is
> > | > on my
> > | > >other&nbsp;machine, a WIndows 95 desktop, and cannot get it to
> > run.&nbsp;
> > | > >Everytime I try, I get "Unable to create&nbsp;environment file."
> > message.
> > | It's
> > | > >been a long time since I did this, and so far tech support has been
> > | unable to
> > | > >see what's wrong. It's a familiar error message, somewhere in the
> dark
> > | > recesses
> > | > >of my mind I remember a simple fix, but can't figure it
> > out!</FONT></DIV>
> > | > ><DIV><FONT face=Arial size=2></FONT>&nbsp;</DIV>
> > | > ><DIV><FONT face=Arial size=2>Settings:</FONT></DIV>
> > | > ><DIV><FONT face=Arial size=2></FONT>&nbsp;</DIV>
> > | > ><DIV><FONT face=Arial size=2>Icon </FONT></DIV>
> > | > ><DIV><FONT face=Arial size=2>Properties:</FONT></DIV>
> > | > ><DIV><FONT face=Arial size=2>CMD line:&nbsp;
> > | C:\WINDOWS\RB1A.BAT</FONT></DIV>
> > | > ><DIV><FONT face=Arial size=2>Working: C:\RBDOS61A</FONT></DIV>
> > | > ><DIV><FONT face=Arial size=2>Shortcut key: none</FONT></DIV>
> > | > ><DIV><FONT face=Arial size=2>Run: Normal Window or Maximized,
neither
> > | > >work</FONT></DIV>
> > | > ><DIV><FONT face=Arial size=2>Close on Exit: yes</FONT></DIV>
> > | > ><DIV><FONT face=Arial size=2></FONT>&nbsp;</DIV>
> > | > ><DIV><FONT face=Arial size=2>Advanced Settings:Prevent MS DOS
> programs
> > | from
> > | > >detecting Windows</FONT></DIV>
> > | > ><DIV><FONT face=Arial size=2></FONT>&nbsp;</DIV>
> > | > ><DIV><FONT face=Arial size=2>MEMORY:</FONT></DIV>
> > | > ><DIV><FONT face=Arial size=2></FONT>&nbsp;</DIV>
> > | > ><DIV><FONT face=Arial size=2>Conventional Memory: Total
> > 440</FONT></DIV>
> > | > ><DIV><FONT face=Arial size=2>Initial Environment: 4096</FONT></DIV>
> > | > ><DIV><FONT face=Arial size=2></FONT>&nbsp;</DIV>
> > | > ><DIV><FONT face=Arial size=2>Protected: yes</FONT></DIV>
> > | > ><DIV><FONT face=Arial size=2></FONT>&nbsp;</DIV>
> > | > ><DIV><FONT face=Arial size=2>Expanded memory: 1024</FONT></DIV>
> > | > ><DIV><FONT face=Arial size=2>Extended memory: None</FONT></DIV>
> > | > ><DIV><FONT face=Arial size=2>Uses HMA: Yes</FONT></DIV>
> > | > ><DIV><FONT face=Arial size=2></FONT>&nbsp;</DIV>
> > | > ><DIV><FONT face=Arial size=2>MS-DOS memory: 8192</FONT></DIV>
> > | > ><DIV><FONT face=Arial size=2></FONT>&nbsp;</DIV>
> > | > ><DIV><FONT face=Arial size=2>Since default paths are for R:Base 6.5
> > | > Windows, the
> > | > >batch file resets path for C:\RBDOS61A and C:\RBDOS61A\SERVER, runs
> > RBASE
> > | and
> > | > >then resets to default paths</FONT></DIV>
> > | > ><DIV><FONT face=Arial size=2></FONT>&nbsp;</DIV>
> > | > ><DIV><FONT face=Arial size=2>There are a C:\TEMP and a C:\TMP and
in
> > | > >AUTOEXEC.BAT, I have SET TEMP = C:\TEMP and SET TMP =
> > | C:\TMP.</FONT></DIV>
> > | > ><DIV><FONT face=Arial size=2></FONT>&nbsp;</DIV>
> > | > ><DIV><FONT face=Arial size=2>In CONFIG.SYS, FILES=60 and
> > | > BUFFERS=60</FONT></DIV>
> > | > ><DIV><FONT face=Arial size=2></FONT>&nbsp;</DIV>
> > | > ><DIV><FONT face=Arial size=2>I get the same error whether I use the
> > icon
> > | or go
> > | > >to DOS in C:\RBDOS61A and type "RBASE"</FONT></DIV>
> > | > ><DIV><FONT face=Arial size=2></FONT>&nbsp;</DIV>
> > | > ><DIV><FONT face=Arial size=2>Any suggestions?</FONT></DIV>
> > | > ><DIV><FONT face=Arial size=2></FONT>&nbsp;</DIV>
> > | > ><DIV><FONT face=Arial size=2>David Blocker</FONT></DIV>
> > | > ><DIV>&nbsp;</DIV></BODY></HTML>
> > | > >
> > | >
> > | > ================================================
> > | > TO SEE MESSAGE POSTING GUIDELINES:
> > | > Send a plain text email to [EMAIL PROTECTED]
> > | > In the message body, put just two words: INTRO rbase-l
> > | > ================================================
> > | > TO UNSUBSCRIBE: send a plain text email to [EMAIL PROTECTED]
> > | > In the message body, put just two words: UNSUBSCRIBE rbase-l
> > |
> > | ================================================
> > | TO SEE MESSAGE POSTING GUIDELINES:
> > | Send a plain text email to [EMAIL PROTECTED]
> > | In the message body, put just two words: INTRO rbase-l
> > | ================================================
> > | TO UNSUBSCRIBE: send a plain text email to [EMAIL PROTECTED]
> > | In the message body, put just two words: UNSUBSCRIBE rbase-l
> >
> > ================================================
> > TO SEE MESSAGE POSTING GUIDELINES:
> > Send a plain text email to [EMAIL PROTECTED]
> > In the message body, put just two words: INTRO rbase-l
> > ================================================
> > TO UNSUBSCRIBE: send a plain text email to [EMAIL PROTECTED]
> > In the message body, put just two words: UNSUBSCRIBE rbase-l
>
> ================================================
> TO SEE MESSAGE POSTING GUIDELINES:
> Send a plain text email to [EMAIL PROTECTED]
> In the message body, put just two words: INTRO rbase-l
> ================================================
> TO UNSUBSCRIBE: send a plain text email to [EMAIL PROTECTED]
> In the message body, put just two words: UNSUBSCRIBE rbase-l
>


================================================
TO SEE MESSAGE POSTING GUIDELINES:
Send a plain text email to [EMAIL PROTECTED]
In the message body, put just two words: INTRO rbase-l
================================================
TO UNSUBSCRIBE: send a plain text email to [EMAIL PROTECTED]
In the message body, put just two words: UNSUBSCRIBE rbase-l

Reply via email to