0

I am creating some QR images and wish to store in a shared folder path which requires username and password to access.

qrFolder = '\\cmbpnh01-srv-03\Tidata\12. IT Projects\QR Code Creation\QA QR Code Creation'
user = 'xxx\xxx'
password = 'xxx'
winCMD = 'NET USE ' + qrFolder + ' /User:' + user + ' ' + password

qrFilename = winCMD + " " + agentcode + "_" + outlet

img.save(qrFilename + imageExt)

Error: OSError: [Errno 22] Invalid argument: 'NET USE \cmbpnh01-srv-03\Tidata\n. IT Projects\QR Code Creation\QA QR Code Creation /User:xxx\xxx xxx ALVALLSR01_ALV0030138.png'

The objective is to store all QR codes inside the shared folder path which requires credentials. You could suggest any other approaches which can achieve this objective. Thanks!

  • I can't see where you define *img* or *imageExt*, so I'm only guessing, but I assume the problem is that *img.save()* requires a valid file name and *NET USE \cmbpnh01-srv-03\Tidata\n. IT Projects\QR Code Creation\QA QR Code Creation /User:xxx\xxx xxx ALVALLSR01_ALV0030138.png* is not a valid file name. – Nicholas Hunter May 19 '21 at 03:23
  • Yes this is not the full code and I only pasted the parts which might cause the error. I just want to store all the images in the shared folder path (which requires credentials). You could suggest any other approaches which can achieve it. – Yoki Watanabe May 19 '21 at 03:33
  • I suggest you type "[python] shared folder credentials" into the search box at the top of the page. It seems that there are several possible approaches to your issue. – Nicholas Hunter May 19 '21 at 03:56

0 Answers0