3

I have been struggling to find out opening of windows explorer with particular folder location in documentation. I have tried:

import subprocess
subprocess.Popen(r'explorer /select,mypath')

All suggestions are welcome!!

Terry Jan Reedy
  • 17,284
  • 1
  • 38
  • 50
samsap
  • 66
  • 2
  • 6

3 Answers3

6

To open specific folder in explorer:

import subprocess
subprocess.Popen('explorer "D:\your_path"')

To open explorer with specific folder selected

import subprocess
subprocess.Popen(r'explorer /select,"D:\your_path"')
Amit Bhoraniya
  • 621
  • 3
  • 14
0

You need to add the actual path to the subprocess.Popen function call. Use this

import subprocess
subprocess.Popen(r'explorer /select,"C:\path\of\folder\file"')
congusbongus
  • 12,079
  • 5
  • 68
  • 93
Sahadev
  • 1,278
  • 4
  • 20
  • 38
0

To open explorer of particular location use:

import subprocess
subprocess.Popen('explorer "C:\path\to\folder"')
Kenly
  • 19,646
  • 6
  • 41
  • 57