?
Solved

How to find "path" in Windows 10

Posted on 2016-08-22
12
Medium Priority
?
77 Views
Last Modified: 2016-08-23
Hi, I am writing a scrip for AutoHotkeys and I need the path for 1) This PC and 2) Control Panel.  Can someone help out please? Thanks
0
Comment
Question by:camtz
  • 6
  • 5
12 Comments
 
LVL 35

Accepted Solution

by:
it_saige earned 2000 total points
ID: 41765794
This PC:
%WinDir%\explorer.exe /e,::{20d04fe0-3aea-1069-a2d8-08002b30309d}
Or 
explorer.exe shell:::{20D04FE0-3AEA-1069-A2D8-08002B30309D}

Open in new window


Control Panel:
%windir%\system32\control.exe

Open in new window


-saige-
0
 

Author Comment

by:camtz
ID: 41765917
Many thanks - appreciate that.
0
 
LVL 57

Expert Comment

by:Joe Winograd, EE MVE 2015&2016
ID: 41765930
Hi Carlos,
I see that you already closed this, but as someone who writes a lot of AutoHotkey code, I'm curious how you're going to use This PC and Control Panel in AHK scripts. If you don't mind sharing, I'd appreciate knowing. Thanks, Joe
0
Free Tool: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

 

Author Comment

by:camtz
ID: 41766311
You bet.  I like to use hot keys to open folders, documents, programs, etc.  It makes the job much easier.  Two keys and your program(s) open up.  Unfortunately, none of the scripts he gave me open up THIS PC, (what use to be "my computer" - can you help me with that? Thanks
Carlos
0
 
LVL 57

Expert Comment

by:Joe Winograd, EE MVE 2015&2016
ID: 41766331
> open up THIS PC, (what use to be "my computer" - can you help me with that?

Sure. Just put this one line of code in your AutoHotkey script:
Run,::{20d04fe0-3aea-1069-a2d8-08002b30309d}

Open in new window

It works in both W7 (giving you My Computer) and W10 (giving you This PC).

Assign it to whatever hotkey you want. For example, let's say F12. Then your AHK script would look like this:
F12::
Run,::{20d04fe0-3aea-1069-a2d8-08002b30309d}
Return

Open in new window

I'm sure you already have an AHK script that runs at startup to define all your hotkeys. Just add it to that script using, of course, whatever hotkey you prefer for it.

Regarding Control Panel, its CLSID is not supported by the Run command, so to get that with a hotkey, put this in your AHK script:
Run,%A_WinDir%\system32\control.exe

Open in new window

Once again, assign it to whatever hotkey you want.

FYI, here's the CLSID list at the AutoHotkey site:
https://autohotkey.com/docs/misc/CLSID-List.htm

It's important to note the "Supported by Run" column. Also, note the caveat:
The "Yes" entries in the last column are not authoritative: the Run command might support different CLSIDs depending on system configuration.
Also, you'll notice that I used a built-in variable called A_WinDir in that line of code. Here's the complete list of Operating System and User Info built-in variables that AutoHotkey provides:
https://autohotkey.com/docs/Variables.htm#os

Regards, Joe
0
 

Author Comment

by:camtz
ID: 41767136
All of this is very helpful.  Thank you for that.  I am still learning all the intricacies of AutoHotKeys and loving every minute of it.  It is a wonderful program.
0
 

Author Comment

by:camtz
ID: 41767138
BTW, I didn't know that you could continue to comment on a question once it had been closed.  Does that mean that you could continue to use the same question and ask for clarification such as in this case?
0
 
LVL 57

Expert Comment

by:Joe Winograd, EE MVE 2015&2016
ID: 41767179
You're welcome. I agree — AutoHotkey is a fantastic program!

Yes, you may comment on questions after they have closed, and it is a very valuable feature (I've seen comments on threads literally years after they have closed). For example, sometimes an expert won't even see a question until after it has closed, but still has some good input to provide. Another example of its use is what you mentioned — getting clarification on some issues. The only thing I would caution you on with respect to its use is not to divert into a wholly new question. For clarifications and new input directly related to the question, it's fine to post after closing. But if it veers into a new matter, you should post a new question, imo. Regards, Joe
0
 

Author Comment

by:camtz
ID: 41768029
Just in case someone sees this, I have tried several things to create an AHK to SHUTDOWN the computer but nothing has worked so far.  Joe, if you see this, would appreciate your help.  Thanks
Carlos
0
 
LVL 57

Expert Comment

by:Joe Winograd, EE MVE 2015&2016
ID: 41768081
Hi Carlos,
This is what I meant by veering into a new matter. This question is unrelated to finding a path for This PC and Control Panel and should be a new question. A popular technique that askers use when there is good reason to want the same experts on a follow-up question is to post a message at the closed question with a link to the new question. In other words, your post here could be something like this:
Thanks for your help on this question. I just asked a new one that also involves AutoHotkey. I'd appreciate it if you take a look at it:

https://www.experts-exchange.com/questions/1234567890/MyNewQuestion
Thanks, Carlos
Also, when you say something like, "I have tried several things...but nothing has worked so far...", it is helpful to show what you have tried. This may avoid folks suggesting ideas that you have already tried but do not work. For example, my first suggestion would be an AHK script with this one line of code:
Run,shutdown.exe /s

Open in new window

But maybe you already tried that and it doesn't work, which would be helpful for me to know. Btw, you may see the full syntax for shutdown.exe by typing this in a command prompt:

shutdown /?

Regards, Joe
0
 

Author Comment

by:camtz
ID: 41768159
Joe, I get it now.  Your suggestion on the follow up makes a lot of sense and that's the way I'll handled it in the future.  There are many times when I close a question but come to find out later that not everything worked out.  So, in the future I will comment as suggested and post a new question.  BTW, I had not asked for this code up above but I am very thankful that you provided it.  Just tested it and it worked fine.  I was not using the " /s" at the end. Thanks again for all your help.
Adios
0
 
LVL 57

Expert Comment

by:Joe Winograd, EE MVE 2015&2016
ID: 41768164
You're welcome, Carlos. As always, happy to help you. Regards, Joe
0

Featured Post

Free Tool: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

If you get a (Blue Screen of Death), your system writes a small file called a minidump. Your first step is to make certain your computer is setup to record memory dumps. Right click My Computer, choose properties. Click on the advanced tab, an…
Active Directory replication delay is the cause to many problems.  Here is a super easy script to force Active Directory replication to all sites with by using an elevated PowerShell command prompt, and a tool to verify your changes.
Learn the basics of lists in Python. Lists, as their name suggests, are a means for ordering and storing values. : Lists are declared using brackets; for example: t = [1, 2, 3]: Lists may contain a mix of data types; for example: t = ['string', 1, T…
This tutorial will teach you the core code needed to finalize the addition of a watermark to your image. The viewer will use a small PHP class to learn and create a watermark.
Suggested Courses
Course of the Month16 days, 17 hours left to enroll

862 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question