Python Forum
Calling exe on network drive
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Calling exe on network drive
#1
Hi
I am trying to call an exe on a network drive
d = "x:\\\RequirmentsEditorInstall.exe"
subprocess.run([d,
                     '/silent',
                     ])
When this runs I get the following
Traceback (most recent call last):
  File "C:\Azure Devops\Agents\TPG\_work\_temp\6f42d270-a33f-46f5-adb5-9ac9afd9a6c0.py", line 22, in <module>
    subprocess.run([d,
  File "C:\Program Files\Python310\lib\subprocess.py", line 501, in run
    with Popen(*popenargs, **kwargs) as process:
  File "C:\Program Files\Python310\lib\subprocess.py", line 966, in __init__
    self._execute_child(args, executable, preexec_fn, close_fds,
  File "C:\Program Files\Python310\lib\subprocess.py", line 1435, in _execute_child
    hp, ht, pid, tid = _winapi.CreateProcess(executable, args,
FileNotFoundError: [WinError 2] The system cannot find the file specified

##[error]The process 'C:\Program Files\Python310\pythonw.exe' failed with exit code 1
Finishing: Produce Requirements Editor Reports
If I execute the command manually it succeeds

What am I doing wrong?
Reply
#2
Try this:
d = r"x:\RequirmentsEditorInstall.exe"
Reply
#3
(Jan-21-2022, 09:04 AM)ibreeden Wrote: Try this:
d = r"x:\RequirmentsEditorInstall.exe"

Unfortunately I get the same result
Reply
#4
That is a pity. I am not sure but could it be you are executing your script with pythonW.exe? This is a version without terminal window and so without stdin, stdout and stderr. This may cause the troubles. Can you execute your script with python.exe instead?
Reply
#5
(Jan-21-2022, 11:23 AM)ibreeden Wrote: That is a pity. I am not sure but could it be you are executing your script with pythonW.exe? This is a version without terminal window and so without stdin, stdout and stderr. This may cause the troubles. Can you execute your script with python.exe instead?
Hi
Seems the trick is to pass shell=True
Thanks for your hints
Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
Question How to get a removable disc type in drive Daring_T 12 970 Feb-11-2024, 08:55 AM
Last Post: Gribouillis
  open python files in other drive akbarza 1 632 Aug-24-2023, 01:23 PM
Last Post: deanhystad
  Integrating Google Drive in App Lahearle 0 440 Jul-19-2023, 05:51 PM
Last Post: Lahearle
  code to send attachments contained on the drive. stefanoste78 1 822 Oct-12-2022, 02:16 AM
Last Post: Larz60+
  access is denied error 5 for network drive mapping ? ahmedbarbary 2 1,731 Aug-17-2022, 10:09 PM
Last Post: ahmedbarbary
  Cant Access D: Drive kucingkembar 4 1,263 Jul-28-2022, 04:53 PM
Last Post: kucingkembar
  Failing to copy file from a network to a local drive tester_V 4 6,974 Jan-20-2021, 07:40 AM
Last Post: tester_V
  Nested Subdirectory within current sub on shared network drive Agregware 1 1,886 Jun-19-2019, 10:07 PM
Last Post: Gribouillis
  trouble with os.listdir on a network drive lconner 10 18,875 Jun-04-2019, 07:16 PM
Last Post: DeaD_EyE
  download file from google drive .. evilcode1 7 13,587 Sep-21-2018, 06:13 PM
Last Post: evilcode1

Forum Jump:

User Panel Messages

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