• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 6774
  • Last Modified:

Batch (.bat) file to launch "My Computer" in Exporer.exe

For example, if I want to  launch "My Documents" in Exporer.exe, I can do a batch (.bat) file that is:

start "" explorer "%HOMEPATH%\My Documents"


If I want to  launch Drive "C:\" in Exporer.exe, I can do a batch (.bat) file that is:

start "" explorer "C:\"


However, if I do:

start "" explorer "My Computer"

It does not work... What is the correct syntax?

Thanks.

Regards.
0
asgarcymed
Asked:
asgarcymed
1 Solution
 
KCTSCommented:
You need to refer to the CLSID - see http://www.jsifaq.com/SF/Tips/Tip.aspx?id=0824
0
 
asgarcymedAuthor Commented:
It is almost perfect - it launches "My Computer", but now a cmd.exe window continues opened; unlike the examples I posted:

start "" explorer "%HOMEPATH%\My Documents"

start "" explorer "My Computer"

Is there any way to such cmd.exe window be automatically be closed? Or it is impossible, and thus, I must close it manually (with a mouse click)?

Thanks.

Regartds.
0
 
kram0Commented:
start "" explorer /e,/root,::{20D04FE0-3AEA-1069-A2D8-08002B30309D}

should work in the batch file...
0
The 14th Annual Expert Award Winners

The results are in! Meet the top members of our 2017 Expert Awards. Congratulations to all who qualified!

 
asgarcymedAuthor Commented:
Now it is PERFECT, THANK YOU!!

Regards.
0
 
kram0Commented:
I only expanded on the answer that KCTS had given you...
0
 
policywatcherCommented:
The problem with the solution given is that while it does display "My Computer" and while the text "My Computer" shows in the title bar, if the address bar is visible, it will show the CLSID rather than "My Computer".

I've recently seen a better solution :

explorer /n,/select,C:

That opens "My Computer", selects the drive C: icon, and displays "My Computer" in the address bar.

0
 
asgarcymedAuthor Commented:
Thank you! It works pretty fine! ;)

Regards.
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

Get expert help—faster!

Need expert help—fast? Use the Help Bell for personalized assistance getting answers to your important questions.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now