Results 1 to 4 of 4
  1. #1
    Join Date
    May 2005

    Unanswered: Detect Root Directory or Windows OS??

    I have a .dll I need to automatically install using vb for access. Basically, it looks to see if the .dll exists and if it doesn't it triggers the installation. My problem is, that I have both Windows XP Pro and Windows 2000 Pro operating systems on my client pc's.

    I need the code to detect either the operating system, or the root directory (C:\winnt for 2000 machines versus c:\windows for XP), so that I can put the .dll in the system32 folder.

    Any ideas?
    Thanks in advance,

  2. #2
    Join Date
    Apr 2004
    Kingsland, Georgia

  3. #3
    Join Date
    May 2005
    OK - Thank you - I tried this code, however, it does not handle for Windows XP Pro.

    I've heard a rumor that the root directory changes in XP for service pack 2 to winnt. I guess what I'm really looking for is a way to run the "echo %systemroot%" windows function to find the root.

  4. #4
    Join Date
    May 2005
    Ok - I found a quick workaround.

    Function findroot()
    Dim objFSO As Object
    'Create objFSO and objIE objects
    Set objFSO = CreateObject("Scripting.FileSystemObject")

    'Determine path to hosts and set strHostsPath to correct path
    Dim bFolder, strHostsPath
    bFolder = objFSO.folderExists("C:\WINDOWS\system32")
    If bFolder = False Then
    strHostsPath = "C:\WINNT\system32"
    strHostsPath = "C:\WINDOWS\system32"

    End If
    findroot = strHostsPath
    End Function

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts