EnableExplicit

Procedure.s GetWinSysPath()
  #xMaxPathLen = 256
  Define.i xLong1
  Define.s GetWinSysPath

  GetWinSysPath = Space(#xMaxPathLen)
  xLong1 = GetSystemDirectory_(@GetWinSysPath, #xMaxPathLen)
  ;xLong1 = FindString(GetWinSysPath, vbNullChar, 1) - 1
  If Len(GetWinSysPath) = #xMaxPathLen
    GetWinSysPath = ""
    Else
    GetWinSysPath = Left(GetWinSysPath, xLong1)
    If Not Right(GetWinSysPath, 1) = "\"
      GetWinSysPath = GetWinSysPath + "\"
      EndIf
    EndIf
  ProcedureReturn GetWinSysPath
  EndProcedure

; IDE Options = PureBasic 5.21 LTS (Windows - x64)
; CursorPosition = 4
; Folding = -
; DisableDebugger
; CompileSourceDirectory