Print Page | Close Window

Retrieve File system info

Printed From: Rocket Software
Category: AccuTerm Knowledge Base (read only)
Forum Name: Code Samples
Forum Description: Share your code samples and discuss the bundled sample programs
URL: https://forum.asent.com/forum_posts.asp?TID=1412
Printed Date: March 26 2026 at 8:51pm
Software Version: Web Wiz Forums 12.03 - http://www.webwizforums.com


Topic: Retrieve File system info
Posted By: bneylon
Subject: Retrieve File system info
Date Posted: October 01 2008 at 2:55am
I need to to find the drive letter from the share name.  This program will return the drive letter and share name of all your drives that are ready.

   SUBROUTINE FILE.SYSTEM(PATH,STAT)
* program    : FILE.SYSTEM
* programmer : Bruce Neylon
* Date       : 10/01/2008
*
* Description: Return Available file system
*
**********************************************
* Modifications
*
**********************************************
*  Variable setup* bmn 10/01/2008 
   EQU ESC TO CHAR(27), STX TO CHAR(2), CR TO CHAR(13), EM TO CHAR(25)
   SCR='Dim fs, d, dc, s, name'
   SCR=SCR:EM:'Set fs = CreateObject("Scripting.FileSystemObject")'
   SCR=SCR:EM:'Set dc = fs.Drives'
   SCR=SCR:EM:'For Each d In dc'
   SCR=SCR:EM:'  If (d.IsReady) Then'
   SCR=SCR:EM:'    s = s & d.DriveLetter & ":"'
   SCR=SCR:EM:'    If d.DriveType = Remote Then'
   SCR=SCR:EM:'        name = d.ShareName'
   SCR=SCR:EM:'    Else'
   SCR=SCR:EM:'        name = d.VolumeName'
   SCR=SCR:EM:'    End If'
   SCR=SCR:EM:'    s = s & name & Chr$(13)'
   SCR=SCR:EM:'    end if'
   SCR=SCR:EM:'Next'
   SCR=SCR:EM:'InitSession.Output s & Chr$(13)'
   PRINT ESC:STX:'P':SCR:CR:
   ECHO OFF
   PATH = ''
   PROMPT ""
   LOOP
     INPUT TV:
    UNTIL TRIM(TV) = ''
     PATH<-1> = TV
   REPEAT
   PROMPT "?"
   ECHO ON
   RETURN




Print Page | Close Window

Forum Software by Web Wiz Forums® version 12.03 - http://www.webwizforums.com
Copyright ©2001-2019 Web Wiz Ltd. - https://www.webwiz.net