Explorer doesn't open specified folder

Get help with using AutoHotkey (v2 or newer) and its commands and hotkeys
MichaelE
Posts: 1
Joined: 02 May 2024, 08:32

Explorer doesn't open specified folder

02 May 2024, 08:39

Hi All,

First time using AutoHotkey v2, so please be patient ;-)

In the tutorials i found it sais if I use

Run "C:\folder"

an explorer window should open in the C:\Folder directory

However it simply starts an Explorer in some other folder. What am I missing? Apparently it knows to start Explorer from just specifying a path, but why isn't it using it?

In a CMD window I can type "explorer.exe C:\Folder" it works as expected

Thanks for your help
User avatar
boiler
Posts: 17173
Joined: 21 Dec 2014, 02:44

Re: Explorer doesn't open specified folder

02 May 2024, 09:22

I'm guessing that your path isn't really simply C:\folder, and if it has spaces in it, then you need to include quotes around the path as part of the string as described in the Run documentation. What you did does not include the quotes as part of the string but rather are just identifying what's inside them as the literal string. To include the quotes, the function call would have single quotes around the whole string including the double quotes:

Code: Select all

Run '"C:\folder"'

Explained: Strings / Text

Return to “Ask for Help (v2)”

Who is online

Users browsing this forum: Felix Siano, wilkster and 43 guests