Finding Cms.ini in Citrix or Terminal Services

In a typical Citrix or Terminal Services implementation, each network user who uses GainSeeker has a copy of Cms.ini in their Home directory.

In these multisession application hosting environments, it can sometimes be difficult to determine the location of the Cms.ini file currently in use.

To find the location of Cms.ini currently used by GainSeeker, log in to the terminal server as a network user who runs GainSeeker. Then use the GainSeeker Macro Editor module or the macro editor of a product such as Microsoft Word to run the following macro. This macro will report which directory GainSeeker is using to access Cms.ini (the current Windows system path).

  Declare Function GetPrivateProfileString Lib "kernel32" Alias " GetPrivateProfileStringA" ( ByVal lpApplicationName As String, ByVal lpKeyName As String, ByVal lpDefault As String, ByVal lpReturnedString As String, ByVal nSize As Long, ByVal lpFileName As String) As Long

  Private Declare Function GetWindowsDirectory Lib "kernel32" Alias " GetWindowsDirectoryA" (ByVal lpBuffer As String, ByVal nSize As Long) As Long

Sub Main

  Dim plRes As Long

  Dim psPath As String * 200

  Dim psRes As String

   MsgBox("This Macro will return two values." & Chr$(13) & "The first Is the current Windows Directory.  This Is where your CMS.INI file needs To be. " & Chr$(13) & Chr$(10) & "The Second Is the Config Path used by GainSeeker from the CMS.INI.")

   plRes = GetWindowsDirectory(psPath, 200&)

  psRes = Trim$(Mid$(psPath, 1&, InStr(psPath, Chr$(0)) - 1&))

  If Len(psRes) > 0& Then

    If Right$(psRes, 1&) <> "\" Then psRes = psRes & "\"

  End If

   MsgBox ("Current Windows Folder" & Chr$(13) & Chr$(10) & Chr$(10) &psRes & Chr$(13) & Chr$(10) & Chr$(10)  & "This value was obtained using the Windows API Function GetWindowsDirectory.")

   Const IniMax = 4096&

  Dim psTr As String

  Dim plR As Long

   psTr = String$(IniMax, 0&)

  plR = GetPrivateProfileString(" qa/s var", " config_path", "", psTr, IniMax - 1&, "cms.ini")

  If plR = 0& Then MsgBox ("error") Else MsgBox ("Config path used by GainSeeker" & Chr$(13) & Chr$(10) & Chr$(10)  & Left$(psTr, plR) & Chr$(13) & Chr$(10) & Chr$(10) & "This should match the config path from the CMS.INI file In the Windows Folder.")

End Sub

 

More:

Using Cms.ini to specially configure the workstation