FileNotFoundError: [WinError 2] The system cannot find the file specified 1

with open(os.devnull, ‘wb’) as devnull:
subprocess.check_call([‘adb’, ‘start-server’], stdout=devnull,
stderr=devnull)
out = subprocess.check_output([‘adb’, ‘devices’]).splitlines()

while move to new PC its not working anymore.

Install whatever provides the “adb” executable (Android Debug Bridge?), if you haven’t already, and then add the directory that contains “adb.exe” to the system or user PATH if the installer doesn’t do that for you.

after i adding path it appear access is denied. And i put actual path also cant found. Its work while using cmd inside the path.

C:\Program Files\Android\Sdk\platform-tools>adb
Android Debug Bridge version 1.0.41
Version 33.0.3-8952118
Installed as C:\Program Files\Android\Sdk\platform-tools\adb.exe

Addon adb as variable inside system and path C:\Program Files\Android\Sdk\platform-tools\adb.exe

Have you tried adding the cwd parameter?

subprocess.check_call([‘adb’, ‘start-server’], stdout=devnull, stderr=devnull, cwd=r'C:\Program Files\Android\Sdk\platform-tools')