Windows 10: Wrong path type and size on mounted samba share on Windows 10

Discus and support Wrong path type and size on mounted samba share on Windows 10 in Windows 10 Network and Sharing to solve the problem; I use a pretty simple python script (also tried a nodejs script) like the one at the end to find all files in a directory and its subdirectories... Discussion in 'Windows 10 Network and Sharing' started by ElBiggie, Feb 12, 2019.

  1. ElBiggie Win User

    Wrong path type and size on mounted samba share on Windows 10

    I use a pretty simple python script (also tried a nodejs script) like the one at the end to find all files in a directory and its subdirectories together with their file size and modified time. Therefore the script uses stat syscall to retrieve information about a path: type (regular file, directory etc.), size, modified time.

    If I run the script on a local folder on Windows 10, Windows 7 and Ubuntu everything works fine. If I run the script on Windows 7 or Ubuntu on a folder that is a mounted samba share, everything works fine, too.

    However, if I run the script on Windows 10 on a folder that is on a mounted samba share, things start to get weird. I get error messages like the following:


    Traceback (most recent call last):

    File "", line 10, in <module>

    childs = listdir(next)

    WindowsError: [Error 267] The directory name is invalid: 'y:\\some\\path\\file.jpg\\*.*'

    This happens, because the result of the stat call states that the path is a directory, although it is a regular jpg file. If I start an interactive python or nodejs shell and call stat for the reported file, the return value looks ok this time (correct type, size etc.). It looks like the samba client on Windows 10 bungles when too many stat calls are issued in a short time interval.

    Is this a known problem? To me it looks like a fatal bug. Is there a way to get around this problem by using some Windows 10 settings?

    In my case the script is actually the base for a backup application ... which will totally do the wrong thing if file sizes and types are returned incorrectly.

    Note: I tested 2 Windows clients running Windows 10. The 3 tested samba servers are running Ubuntu using pretty much Ubuntu's default smbd configs (besides share definitions). I also tried to force SMB2 but that didn't change anything.


    The python script. The nodejs script (not listed here) does pretty much the same thing:

    from os import listdir, stat

    from os.path import join

    from stat import *

    files = []

    todo = ['y:\\'] # y:\\ is a mounted samba share

    while len(todo) > 0:

    next = todo.pop(0)

    childs = listdir(next)

    for child in childs:

    childPath = join(next, child)

    childStat = stat(childPath)

    mode = childStat.st_mode

    if S_ISREG(mode):


    elif S_ISDIR(mode):


    print len(files) # Will not be called because error is thrown before on Windows 10

    ElBiggie, Feb 12, 2019
  2. mbratch Win User

    Samba Shares don't show up in Windows 10 Network

    I have a peculiar Samba share issue.

    I was running Windows 7 on my laptop. I have a file server running Linux and Samba. When I open the Network icon in Windows 7, I see my server there and I can open it and access the associated folder shares.

    I upgraded to Windows 10. Now if I double click the network icon, I don't see any machines except my local client laptop. However, if I enter the UNC path to my samba server (\\myserver) into the path bar of Windows Explorer, I can access the server. If I want to add a network printer to my laptop that is shared by the server, it won't find the server in the search list. However, I can enter the literal UNC path to the printer and add it. So it has something to do with nmb I think? Not sure.

    Any suggestions on how to resolve it?
    mbratch, Feb 12, 2019
  3. Windows 10 won't mount Samba share from Debian

    Hello, I have a server running Debian that has a Samba share configured. When I try to connect to that share from my Windows 10 PC by entering "\\\share_name" where "" is the IP address of the Debian server and "share_name" is the
    name of the share, I am prompted for my credentials with a red message at the bottom of the prompt saying "Access is denied." I then enter just my username "sean" as the username and then my password and I get the same prompt for credentials with a message
    in red at the bottom that says: "The username or password is incorrect." I then try adding the workgroup ("WORKGROUP") to my username (i.e "WORKGROUP\sean") and I get the same message. I tried making it all lower case ("workgroup\sean") and that doesn't help.

    I am able to mount this share on another Debian server both by specifying just my username in the mount command's options and by specifying the username and password. Both work.

    On my Windows 10 PC, I do have the "Enable file sharing for devices that use 40- or 56-bit encryption" option enabled in case that helps. I can mount my Windows 10 shares on that Debian server, but I need to mount the Debian server's shares on the Windows
    10 PC. Because I can mount the share on another PC, I'm under the impression the issue is with my Windows 10 PC. How do I make this work?
    SeanKillian, Feb 12, 2019
  4. jimbo45 Win User

    Wrong path type and size on mounted samba share on Windows 10

    Creating a samba share in windows 10

    Hi there


    Not sure what Linux distro you've got - I'm using CENTOS 7

    For SAMBA ensure latest packages are installed - you need the SERVER (and the client as well if you want to see Shares on your Linux system from other Linux systems / Windows systems).

    On Windows and the Linux system create accounts (users) with passwords who can access the shares
    On the Linux system allow SAMBA through any firewall -- for testing I'd switch firewalls off on BOTH Linux and Windows to get the thing working

    once SAMBA is up and running

    on the Linux side -- first create your smb.config file -- will show that later in this post.

    Ensure the files are mounted on the Linux system. I'll share 2 entire HDD's which are /dev/sdb and /dev/sdc and I'll mount to mnt/DV1 and /mnt/DV2. ( Simply create READ / WRITE empty directories in /mnt.

    to mount

    mount /dev/sdb -t auto -o rw /mnt/DV1
    mount /dev/sdc -t auto -o rw /mnt/DV2

    now for the samba bits

    1) as root or sudo ---enter this commands
    smbpasswd -a user password where user = user and password = users password. This only needs to be done once.

    2) after each boot start the samba daemons -- service smb start, service nmb start. Note on some Linux distros the daemons might be smbd and nmbd and you might need systemctl service command rather than just service.

    3) use a smb.conf file similar to this -- has a very simple config and almost now security but easy for testing. Once you've got it all working you can then tighten up security. The file usually resides in /etc/samba

    #======================= Global Settings =====================================

    max protocol = SMB3
    # can set it to SMB2 if you want experimental SMB2 support.
    workgroup = WORKGROUP
    server string = Samba Server Version %v

    ; max protocol = SMB2

    log file = /var/log/samba/log.%m
    max log size = 50
    security = user
    passdb backend = tdbsam
    name resolve order = bcast host lmhosts wins

    load printers = yes
    cups options = raw

    ; printcap name = /etc/printcap
    # obtain a list of printers automatically on UNIX System V systems:
    ; printcap name = lpstat
    ; printing = cups

    #============================ Share Definitions ==============================

    comment = Home Directories
    browseable = yes
    writable = yes
    valid users = %S

    comment = All Printers
    path = /var/spool/samba
    browseable = no
    guest ok = no
    writable = no
    printable = yes

    comment HDD1
    path = /mnt/DV1
    guest ok = yes
    writeable = yes
    browseable = yes

    comment HDD2
    path = /mnt/DV2
    guest ok = yes
    writeable = yes
    browseable = yes

    On the Windows system you should see HDD1 and HDD2 under the computer when you map the network

    Mount these as network drives (file explorer --> connect network drive).

    I'd stop windows firewall to while testing -- both inbound and outbound.

    Note after SAMBA start Windows takes a few minutes before it sees the updated network.

    Wrong path type and size on mounted samba share on Windows 10 [​IMG]

    Attachment 117217

    I'm using latest version of W10 PRO X-64. Latest updates applied too.

    On your Linux system you should be able to see the SAMBA connections in your file browser easily enough too.

    Wrong path type and size on mounted samba share on Windows 10 [​IMG]

    jimbo45, Feb 12, 2019

Wrong path type and size on mounted samba share on Windows 10

  1. Wrong path type and size on mounted samba share on Windows 10 - Similar Threads - Wrong path type

  2. XP to NAS / SAMBA shares

    in Windows 10 Virtualization
    XP to NAS / SAMBA shares: Hi folks If you have XP VM's and you want to access SAMBA type shares then you'll need to add these 2 lines in the global section of the samba.conf file. (Note on the NAS / SAMBA server file. There's nothing extra to do on the XP system. (The NAS can usually by default...
  3. Cannot access Samba share

    in Windows 10 Network and Sharing
    Cannot access Samba share: Hi, I have a few Windows 10 computers and some linux computers on my network. I use Samba to enable sharing between the Windows and Linux computers. On one of the Windows computer I have a Storage Spaces drive set up as a Samba share. I can access some of the folders on this...
  4. Unable to mount network share in windows 10

    in Windows 10 Network and Sharing
    Unable to mount network share in windows 10: Hello, I am trying to mount a network share in windows 10, but everytime I try I get this error message [ATTACH] I know this is a problem with Windows 10 because I tried this on my chromebook and it dosen't have the same problem. Any help will be appreciated,...
  5. Wrong path for Windows 10 shell startup?

    in Windows 10 Support
    Wrong path for Windows 10 shell startup?: I want a program to start automatically at startup. I pressed Windows+R, typed shell:startup and Enter. The Startup folder opened. I created a shortcut on the desktop and copied/paste it into the startup folder. I restarted, but the program did not start automatically as...
  6. BSOD mounting ISO natively from samba share

    in Windows 10 BSOD Crashes and Debugging
    BSOD mounting ISO natively from samba share: To reproduce: 1) You need a network share drive on another device that is mapped locally as a drive. 2) Place an ISO image of some kind in a location on that shared drive. 3) Attempt to open the ISO natively (double-click or right click-> open as...) I have not...
  7. Samba share doesn't work

    in Windows 10 Network and Sharing
    Samba share doesn't work: Hi, I have Vbox with Ubuntu Server 14.04 LTS installed on it. My host is Win 10 (Version 10.0.10240 Build 10240). I've tried to get my samba share working for the whole day. I asked in #Windows, #ubuntu, #samba, #php, everywhere. I've googled and googled and googled.......
  8. Unable to See Samba Share

    in Windows 10 Network and Sharing
    Unable to See Samba Share: Hi everyone, I'll try to keep it short. I have a headless ubuntu server that has a samba server. It's connected to the network with a cable (not wifi) and has a static IP. My desktop (also wired with static IP) is unable to see the samba share at all: not when I go to the...
  9. Creating a samba share in windows 10

    in Windows 10 Network and Sharing
    Creating a samba share in windows 10: I've been using unauthenticated samba share on my computer for well over a decade using windows 7, vista, and XP (and maybe even further back) to network with various devices in another room via an ethernet cable. I believe Microsoft removed unauthenticated samba shares from...
  10. Can't access Samba shares on 10049

    in Windows 10 Network and Sharing
    Can't access Samba shares on 10049: I just reinstalled after I was having issues. Everything seems to be working smoothly, except that I can't access the shares on all but one of my other computers for some reason. Most devices that aren't running either some flavor of Windows or Samba show up just fine. I...