Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Script to open explorer on "My Computer"

Status
Not open for further replies.

jtflex

Technical User
Feb 20, 2004
32
US
Hi I'm new to Windows Scripting so bear with me.

I'm trying to write a simple script that when executed. Explorer opens up on "MY Computer" showing all the drives available.

I have a script working that opens Explorer to folders or files. I also have a script that will just open Explorer which then defaults to "My Documents"

Is there a specific path or specific name other then "My computer" to add to my script?

Here is the simple script I have for opening up just Explorer:

set fs = CreateObject("Scripting.FileSystemObject")
set wshshell = CreateObject("WScript.Shell")
command = "Explorer.exe "
wshshell.run command

Any ideas of what to add to it?

I'm using W2K and Win Script Host.

Thanks
Joe
 
Create a shortcut to My Computer (the easiest way to do this is to right-click and hold on My Computer, drag to the side and release the button, this will ask you if you want to create a Shorcut). Move the shortcut to where-ever you want it (for this example I put it directly on the C: drive). Now you can open it by calling "C:\My Computer.lnk" (The quotes are necessary because there is a space). Hope this helps.
 
You can also use

explorer.exe /e

from a command line (or script) to open explorer in two pane mode. It should start w/ c:\ in focus, but show all the drives.
 
jtflex wrote:
>I'm trying to write a simple script that when executed. Explorer opens up on "MY Computer" showing all the drives available.

"My Computer" is a very much localized and is accessed with reference to its class identity.
The command script line should therefore read like this.
[tt] command = "Explorer.exe /e,::{20D04FE0-3AEA-1069-A2D8-08002B30309D}"[/tt]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top