Windows 7 and Deletion of rsc files

Where are GEOPAK SS2's .rsc files stored by default on a Windows 7 64-bit installation?  In the past I used a batch file to delete all .rsc files in GEOPAK's bin directory if necessary.  Where should I point this batch file to now?

Josh Mauritz

MS v08.11.07.443
GPK v08.11.07.427
Windows 7 64-bit

  • It will be different on every computer based on your user name and version of MicroStation. On mine it is

    C:\Users\Derricke.Gray\AppData\Local\Bentley\MicroStation\8.11\7wluuhxFFX1cmFA2Mrvnsw\GEOPAK

    Note: You can re-direct the RSC files using the GPK_RSCDIR configuration variable.

    Derricke


    This is a test

  • Here is the code out of a VB 6 form we created to delete both the rsc files and the upf. We use the new variable that Derricke references so it doesn't matter if you know where the resource files are as long as MicroStation knows.

    VERSION 5.00
    Begin VB.Form UserFormDeleteRSC
       Caption         =   "Delete RSC and UPF Files"
       ClientHeight    =   1515
       ClientLeft      =   60
       ClientTop       =   450
       ClientWidth     =   3780
       LinkTopic       =   "Form1"
       ScaleHeight     =   1515
       ScaleWidth      =   3780
       StartUpPosition =   3  'Windows Default
       Begin VB.CheckBox CheckV8i
          Caption         =   "Delete MicroStation V8i RSC Files"
          Height          =   255
          Left            =   360
          TabIndex        =   3
          Top             =   120
          Width           =   3255
       End
       Begin VB.CheckBox CheckBoxUPF
          Caption         =   "Delete MicroStation V8i UPF"
          Height          =   255
          Left            =   360
          TabIndex        =   2
          Top             =   360
          Width           =   2895
       End
       Begin VB.CommandButton Command1
          Caption         =   "OK"
          Height          =   375
          Index           =   1
          Left            =   1920
          TabIndex        =   1
          Top             =   720
          Width           =   1215
       End
       Begin VB.CommandButton CommandButton2
          Caption         =   "Exit"
          Height          =   375
          Index           =   0
          Left            =   480
          TabIndex        =   0
          Top             =   720
          Width           =   1215
       End
    End
    Attribute VB_Name = "UserFormDeleteRSC"
    Attribute VB_GlobalNameSpace = False
    Attribute VB_Creatable = False
    Attribute VB_PredeclaredId = True
    Attribute VB_Exposed = False
    Dim counter As Integer
    Dim DirectoryCounter As Integer

    Private Sub Command1_Click(Index As Integer)

    DirectoryCounter = 0
    counter = 0
    If UserFormDeleteRSC.CheckBoxUPF.Value = False And UserFormDeleteRSC.CheckV8i.Value = 0 Then
        MsgBox "Please check what you would like to delete on the dialog"
        Exit Sub
    End If
    Dim TheFileName As String
    Dim TheFullName As String
    If UserFormDeleteRSC.CheckV8i.Value = 1 Then
        CheckPathV8i = MicroStationDGN.ActiveWorkspace.ConfigurationVariableValue("GPK_RSCDIR")  '"C:\BentleyV8i\GEOPAK\V8.11\bin\"
        CheckPath64_12_09 = "C:\BentleyXM\Geopak\V8.9\bin\"
        CheckPath64 = "C:\Program Files (x86)\BentleyXM\Geopak\V8.9\bin\"
        CheckPath = "C:\Program Files\BentleyXM\Geopak\V8.9\bin\"
        TheAvailablePath = Dir(CheckPath, vbDirectory)
        TheAvailablePath2 = Dir(CheckPath64, vbDirectory)
        TheAvailablePath3 = Dir(CheckPath64_12_09, vbDirectory)
        TheAvailablePath4 = Dir(CheckPathV8i, vbDirectory)
       
        If TheAvailablePath4 = "." Then
            'CheckPath64 for newer machines December of 2009
            mypath = CheckPathV8i
        ElseIf TheAvailablePath = "." Then
            'CheckPath
            mypath = CheckPath
        ElseIf TheAvailablePath2 = "." Then
            'CheckPath64
            mypath = CheckPath64
        ElseIf TheAvailablePath3 = "." Then
            'CheckPath64 for newer machines December of 2009
            mypath = CheckPath64_12_09
        End If
    Dim MicroStationVersionPath As String
    MicroStationVersionPath = mypath
        Myname = Dir(mypath, vbDirectory)    ' Retrieve the first entry.
        Do While Myname <> ""    ' Start the loop.
            If Right(Myname, 3) = "." Or Right(Myname, 3) = ".." Then
                GoTo Skip
            ElseIf Right(Myname, 3) = "rsc" Then
                Kill mypath & Myname
                counter = counter + 1
            End If
            On Error Resume Next
    Skip:
            Myname = Dir
        Loop
    '*************** Go through WOrking Directory ******************
        mypath = ActiveDesignFile.Path & "\"  ' Set the path.
        Myname = Dir(mypath, vbDirectory)    ' Retrieve the first entry.
        Do While Myname <> ""    ' Start the loop.
            If Right(Myname, 3) = "." Or Right(Myname, 3) = ".." Then
                GoTo Skip1
            ElseIf Right(Myname, 3) = "rsc" Then
                Kill mypath & Myname
                DirectoryCounter = DirectoryCounter + 1
            End If
            On Error Resume Next
    Skip1:
            Myname = Dir
        Loop
        MsgBox CStr(counter) & " RSC Files Deleted off " & MicroStationVersionPath & " " & CStr(DirectoryCounter) & " RSC Files deleted from working directoy"
    End If
    If UserFormDeleteRSC.CheckBoxUPF.Value = 1 Then
    On Error Resume Next
        MsgBox "UPF File has been deleted.  MicroStation will now shut down."
        MicroStationDGN.Quit
        DoEvents
        V8iUPFFile = "C:\Docume~1\" & UserName & "\" & UserName & "V8i.upf"
        TheUPFFile = "C:\Docume~1\" & UserName & "\" & UserName & "XM.upf"
        TheDirFile = "C:\Docume~1\" & UserName & "\" & UserName & ".dir"
        Kill TheUPFFile
        Kill TheDirFile
        Kill V8iUPFFile
    End If
    End
    End Sub

    Private Sub CommandButton2_Click(Index As Integer)
        End
    End Sub

    Private Sub Form_Initialize()
    Dim CompName As String
    CompName = "."
        Set objWMI = GetObject("winmgmts:" & "{impersonationLevel=impersonate}!\\" & CompName & "\root\cimv2")

        Set proc = objWMI.ExecQuery("Select * from Win32_Process Where Name = 'ustation.exe'")
            If proc.Count > 1 Then
                'MsgBox "There are more than one instance of MicroStation Running!!!"
            ElseIf proc.Count = 1 Then
                'MsgBox "There is only one instance of MicroStation running."
            Else
                MsgBox "MicroStation must be running in order to set Variable paths for this program to know where to find RSC and UPF Files.  Please start MicroStation and run this program agian."
                End
            End If

    End Sub

     

  • Josh,

    Is there any chance you'd post the code for that batch file?

    Thanks,

    Aaron

  • The code we use is simply:

    @echo off

    title Delete GEOPAK rsc files

    @echo off

    color 1E

    @echo off

    del C:\Users\Josh.MFLD.009\V8iSS\GEOPAK\*.rsc

    pause

    exit

    It is just saved as a .bat file that can be run from the Windows Start menu.  We use a modified MSLOCAL.CFG file (pointed to by a custom shortcut) that sets _USTN_HOMEROOT = $(USERPROFILE)/V8iSS/.  I assume this is how GEOPAK knows to store its rsc files under this directory.

    HTH,

    Josh

  • Please refer to the following article for Deleting GEOPAK Resource files.

    communities.bentley.com/.../15923.geopak-resource-files-how-to-remove-them-and-why.aspx


    For more information about the Road and Site design tools, visit the Road and Site design WIKI at: http://communities.bentley.com/products/road___site_design/w/road_and_site_design__wiki