Solved

How to find "path" in Windows 10

Posted on 2016-08-22
12
49 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 32

Accepted Solution

by:
it_saige earned 500 total points
Comment Utility
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
Comment Utility
Many thanks - appreciate that.
0
 
LVL 51

Expert Comment

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

Author Comment

by:camtz
Comment Utility
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 51

Expert Comment

by:Joe Winograd, EE MVE
Comment Utility
> 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
Comment Utility
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
Do You Know the 4 Main Threat Actor Types?

Do you know the main threat actor types? Most attackers fall into one of four categories, each with their own favored tactics, techniques, and procedures.

 

Author Comment

by:camtz
Comment Utility
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 51

Expert Comment

by:Joe Winograd, EE MVE
Comment Utility
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
Comment Utility
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 51

Expert Comment

by:Joe Winograd, EE MVE
Comment Utility
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
Comment Utility
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 51

Expert Comment

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

Featured Post

IT, Stop Being Called Into Every Meeting

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

Join & Write a Comment

Suggested Solutions

I hope you'll find this tutorial useful and interesting. So let's try to extend Tcl with a new package.  For anyone more deeply interested please check out the book "Practical Programming in Tcl and Tk". It's really one of the best written books abo…
Batch, VBS, and scripts in general are incredibly useful for repetitive tasks.  Some tasks can take a while to complete and it can be annoying to check back only to discover that your script finished 5 minutes ago.  Some scripts may complete nearly …
Learn the basics of if, else, and elif statements in Python 2.7. Use "if" statements to test a specified condition.: The structure of an if statement is as follows: (CODE) Use "else" statements to allow the execution of an alternative, if the …
In this fourth video of the Xpdf series, we discuss and demonstrate the PDFinfo utility, which retrieves the contents of a PDF's Info Dictionary, as well as some other information, including the page count. We show how to isolate the page count in a…

771 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

Need Help in Real-Time?

Connect with top rated Experts

13 Experts available now in Live!

Get 1:1 Help Now