Solved

How to find "path" in Windows 10

Posted on 2016-08-22
12
59 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 33

Accepted Solution

by:
it_saige earned 500 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 53

Expert Comment

by:Joe Winograd, EE MVE
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
Resolve Critical IT Incidents Fast

If your data, services or processes become compromised, your organization can suffer damage in just minutes and how fast you communicate during a major IT incident is everything. Learn how to immediately identify incidents & best practices to resolve them quickly and effectively.

 

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 53

Expert Comment

by:Joe Winograd, EE MVE
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 53

Expert Comment

by:Joe Winograd, EE MVE
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 53

Expert Comment

by:Joe Winograd, EE MVE
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 53

Expert Comment

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

Featured Post

Master Your Team's Linux and Cloud Stack!

The average business loses $13.5M per year to ineffective training (per 1,000 employees). Keep ahead of the competition and combine in-person quality with online cost and flexibility by training with Linux Academy.

Question has a verified solution.

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

In this tutorial I will aim to show you how simple is making a small application in WhizBase, how to add, remove and update data in the DB. I will make a small address book application where you can add, browse, update and remove addresses. I wi…
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…
Learn the basics of modules and packages in Python. Every Python file is a module, ending in the suffix: .py: Modules are a collection of functions and variables.: Packages are a collection of modules.: Module functions and variables are accessed us…
The viewer will learn how to look for a specific file type in a local or remote server directory using PHP.

839 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