Python Forum
Failing to connect by 'net use'
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Failing to connect by 'net use'
#1
Greetings to those that still up at this time! Wink
I'm failing to map network shares.
I'm identifying "letters not in use" for a share to mount and use it as a variable
and using a list of IPs to connect to.
Here is sniped:
import subprocess
drl  = 'A'  # Script identifies the letter not used for mounting shares
e_ip = '10.0.0.7' # IP from IP list
mp_string = f"net use {drl}:\\\\{e_ip}\\c$ /u:someuser somepassword"
print(f" -- {mp_string}")
subprocess.call(mp_string)
Could you help me with this?
Reply
#2
My bad! Wink
I missed little space:

before:
"net use {drl}:\\\\{e_ip}\\c$ /u:someuser somepassword"
after:
"net use"+" "+drl+":"+" \\\\"+e_ip+"\\c$ /u:someuser somepassword"	
I'm OK now.
Thank you!
Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
  Failing regex tester_V 3 1,272 Aug-16-2022, 03:53 PM
Last Post: deanhystad
  Failing to connect to a host with WMI tester_V 6 4,532 Aug-10-2021, 06:25 PM
Last Post: tester_V
  Failing to get Stat for a Directory tester_V 11 3,712 Jul-20-2021, 10:59 PM
Last Post: Larz60+
  Failing to Zip files tester_V 4 2,248 Dec-01-2020, 07:28 AM
Last Post: tester_V
  Python 3.8 on mac failing to start sgandon 0 2,999 Jan-14-2020, 10:58 AM
Last Post: sgandon
  trying to install oandapy and failing ErnestTBass 0 1,985 Feb-24-2019, 06:13 PM
Last Post: ErnestTBass
  Pyinstaller failing JP_ROMANO 2 4,152 Jan-16-2019, 06:07 PM
Last Post: JP_ROMANO
  Why is my for loop failing? microphone_head 4 3,053 Sep-11-2018, 01:21 PM
Last Post: microphone_head

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020