Rocket Software Homepage
Forum Home Forum Home > AccuTerm Knowledge Base (read only) > Code Samples
  New Posts New Posts RSS Feed - Retrieve File system info
  FAQ FAQ  Forum Search   Register Register  Login Login

The AccuTerm forum has moved. Go to community.rocketsoftware.com to register for the new Rocket forum.

Forum LockedRetrieve File system info

 Post Reply Post Reply
Author
Message
bneylon View Drop Down
Senior Member
Senior Member


Joined: March 03 2004
Location: United States
Status: Offline
Points: 103
Post Options Post Options   Thanks (0) Thanks(0)   Quote bneylon Quote  Post ReplyReply Direct Link To This Post Topic: Retrieve File system info
    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

Back to Top
 Post Reply Post Reply
  Share Topic   

Forum Jump Forum Permissions View Drop Down

Forum Software by Web Wiz Forums® version 12.03
Copyright ©2001-2019 Web Wiz Ltd.