Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

NAS query

Status
Not open for further replies.

edenhope

Programmer
Mar 21, 2008
3
AU
Hello

Can somebody please tell me how I retrieve or save a file to my Lenovo PX2-300D NAS?

I have Windows 10. In File Explorer the NAS drive shows up as

'Lenovo (\\PX2-300D)'

and has W: as its drive letter.

This drive open in File Explorer as any normal HDD and I can view, add, edit folders/files as normal.

I want to retrieve a text file and populate a Listbox in VB6. The text file is in the NAS.

Scripting.FileSystemObject shows all drives connected to my computer but not the NAS!

How do I access this NAS drive (simple instructions please!)

Thank you
Steven


 
Try this code, see if it will pick up your drive.

---- Andy

"Hmm...they have the internet on computers now"--Homer Simpson
 
Thank you Andrzejek

This is the message I received after running the code you sent:

C: Hard Disk Drive
D: Hard Disk Drive
E: CDROM Drive
F: CDROM Drive
All these are internal drives in my desktop

The NAS drive is showing in File Explorer as W:

Thanks again
Steven
 
You have to realize, VB6 is a last century technology, not supported anymore, and has its limitations. This new type of drive may be one of them. :-(

---- Andy

"Hmm...they have the internet on computers now"--Homer Simpson
 
Thanks Andrzejek
That may be so.
Do you think if I ran that code in VB.Net 2019 the drive may be found? I will try it and let you know.
Steven
 
Works fine here:

Code:
Option Explicit

Private Sub Form_Load()
    Const SCRRUN_FILE As String = "scrrun.dll"
    Dim DriveTypeNames As Collection
    Dim MemberInfo As TLI.MemberInfo
    Dim Drive As Scripting.Drive

    AutoRedraw = True
    Set DriveTypeNames = New Collection
    With New TLI.TLIApplication
        With .TypeLibInfoFromFile(SCRRUN_FILE).Constants
            For Each MemberInfo In .NamedItem("DriveTypeConst").Members
                With MemberInfo
                    DriveTypeNames.Add .Name, CStr(.Value)
                End With
            Next
        End With
    End With

    Print "TYPE"; Tab(15); "VOLUME"; Tab(30); "PATH"; Tab(35); "SHARE"
    With New Scripting.FileSystemObject
        For Each Drive In .Drives
            With Drive
                Print DriveTypeNames.Item(CStr(.DriveType));
                If .IsReady Then
                    Print Tab(15); .VolumeName;
                Else
                    Print Tab(15); "*not ready*";
                End If
                Print Tab(30); .Path;
                Print Tab(35); .ShareName
            End With
        Next
    End With
End Sub

Result:

Code:
TYPE          VOLUME         PATH SHARE
Fixed         System         C:   
Fixed         Data Large     D:   
Removable     *not ready*    G:   
Removable     *not ready*    H:   
Removable     *not ready*    I:   
Removable     *not ready*    J:   
CDRom         *not ready*    K:   
Remote        PUBLIC         Z:   \\uShare\PUBLIC

All I can guess is that you didn't map your NAS share to a drive letter in both profiles of the Administrators group account that you use to run VB6.EXE elevated. Since there is no mapping in the elevated profile of that account your programs cannot see it. Try compiling and then run the EXE without elevation.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top