-2

Actually I want to access another computer's drive from my computer which is present in LAN. All LAN computers are password protected, then how to connect my computer to another computer and access drives using python code.

And I have scanning code, only I want to connect one computer to another LAN computer with login credentials and access its drives. Someone help me for this, I have not able to find a solution to this problem.

Update: System is Windows and I can't use other because I am creating app using python code

FallenAngel
  • 15,966
  • 10
  • 78
  • 105
Ashish Jain
  • 720
  • 1
  • 7
  • 23
  • Please elaborate - are you on Windows, Unix/Linux/Mac...? – peterph Oct 08 '13 at 07:27
  • 1
    Does this require python? Many network access options like mounting the remote drive over NFS, using SAMBA, SSH or FTP have solved the problem of disk access with credentials. – icedwater Oct 08 '13 at 07:27
  • @peterph System is Windows and i can't use other bcoz i am creating app using python code – Ashish Jain Oct 08 '13 at 07:30
  • Well, Python is multiplatform, so that really is not the a reason for using Windows. But that's not that important now. – peterph Oct 08 '13 at 07:34

1 Answers1

1

If you are on windows, just attach whatever is needed as a network drive. If you want to do it in a script, use the Windows net command:

net use X: \\Server\directory /user:"DOMAIN\username" "password"

If you need to do it from Python, use os.system() to run the command as Mevin suggests in the comment below.

peterph
  • 950
  • 6
  • 11
  • 1
    You can use the python function `os.system()` to execute this cmd command from python.This might help you http://stackoverflow.com/questions/89228/calling-an-external-command-in-python . – Mevin Babu Oct 08 '13 at 07:35
  • but what python code or script, i have to write for connecting one to another computer with credential. if you have any example or code, please share to me. – Ashish Jain Oct 08 '13 at 07:39
  • @AshishJain Read the question and the link Mevin kindly provided. If you need to learn Python, go to https://wiki.python.org/moin/BeginnersGuide/NonProgrammers or https://wiki.python.org/moin/BeginnersGuide/Programmers. – peterph Oct 08 '13 at 07:43
  • Hi guys, I got python code which will connect one computer to another computer with credentials in LAN network. @peterph thanks for your suggestion but i didn't get from u. – Ashish Jain Oct 09 '13 at 05:33