[Python] 'net' is not recognized as an internal or external command, operable program or batch...

Discussão em 'Python' iniciado por Stack, Março 16, 2025.

  1. Stack

    Stack Membro Participativo

    I am trying to connect to a network drive, I have written below code. But I am fetching 'net' is not recognized as an internal or external command

    import copy,random, unicodedata, re, os
    import subprocess, netrc

    password = "MyPWD"
    domain_name = "MyDomain"
    user_name = "MyName"
    subprocess.call(r'net use m: /del', shell=True)
    os.system(r"NET USE m: \\fileshare\\Users\\Dir %s /USER:%s\%s" % (password, domain_name, user_name))

    Continue reading...

Compartilhe esta Página