Open a folder with File explorer using .bat

You can try like this:

%SystemRoot%\explorer.exe "c:\Yaya\yoyo\"

I think it should be this:

explorer c:/Yaya/yoyo

The start command needs blank quotes at the beginning, as it uses the first double quoted phrase as the "Window title"

start "" "c:\Yaya\yoyo\"

Here are two examples to open folders, one in the location and the other with the folder selected in the parent directory.

:: Open an Explorer window with the 'temp' folder displayed and its parent hidden:
Explorer.exe /e,/root,"%temp%"

:: This one will open the parent directory and automatically select the 'temp' folder:
Explorer.exe /select,"%temp%"

:: See more examples here: https://ss64.com/nt/explorer.html

See more examples here: https://ss64.com/nt/explorer.html

Tags:

Batch File