?
Solved

Opening 'My Computer' Through Browser

Posted on 2003-03-28
32
Medium Priority
?
177 Views
Last Modified: 2010-04-06
I would like to know how to open "My Computer" through a browser (preferably IE)

I have tried various ways (up to my novice standards) and have failed :D

I would be really grateful if someone could help me out.

Thanks , Jackeh ;D
0
Comment
Question by:Jackeh
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 11
  • 11
  • 6
  • +2
32 Comments
 
LVL 1

Expert Comment

by:Victor_R
ID: 8225728
In the IE Address bar simply type "My Computer" and it should open it.
0
 
LVL 3

Expert Comment

by:vosk
ID: 8226333
Also there's other ways, such as use something like that:
<html>
<head>
</head>
<body onLoad="location = 'c:\\WINDOWS'">
</body>
</html>
Just add the root of your 'My PC'.
Another way is using ActiveX, but I think that's not recomended if you aren't sure about what you are doing. If you are interested I'll post a comment abaut that.
jbosch(vosk)
0
 
LVL 3

Expert Comment

by:vosk
ID: 8226368
Another thing: can you be more explicit? Maybe they are other solutions to your problem instead accessing to 'My PC'...
jbosch(vosk)
0
Optimize your web performance

What's in the eBook?
- Full list of reasons for poor performance
- Ultimate measures to speed things up
- Primary web monitoring types
- KPIs you should be monitoring in order to increase your ROI

 
LVL 1

Expert Comment

by:Victor_R
ID: 8226662
He didn't say "accessing My PC", he said "open "My Computer" through a browser".

My Computer is not c:\Windows. It's the folder that lists your drives.

Typing "My Computer" in the address bar will work Jackeh.
0
 

Author Comment

by:Jackeh
ID: 8227053
Hmmm

I tried that before....

<a href="My Computer">My Computer</a>

Doesn't work :P :)

Any idea on how to fix it? ;)
0
 
LVL 1

Expert Comment

by:Victor_R
ID: 8227420
Oh, that's what you want to do.

I don't think that's possible. I've tried a few variations and it doesn't seem to work. I think that is because My Comoputer isn't a proper folder, such as c:\windows. I think a general rule of thumb is if you can't get to it through DOS, you can't link to it through a browser.
0
 
LVL 3

Expert Comment

by:vosk
ID: 8228297
Maybe if you could expalin better what you are trying to do, the solution would be more easy. For the moment that script allows you to access to the units:
<html>
<head>
</head>
<body>
<form action="file:///c|/"><input type="submit" value="c:\ drive"></form>
<form action="file:///a|/"><input type="submit" value="a:\ drive"></form>
<form action="file:///b|/"><input type="submit" value="b:\ drive"></form>
<form action="file:///d|/"><input type="submit" value="d:\ drive"></form>
<form action="file:///e|/"><input type="submit" value="e:\ drive"></form>
</body>
</html>
jbosch(vosk)
0
 

Author Comment

by:Jackeh
ID: 8230465
Hmmmmm.....

Vosk what I am trying to do , make a link , that opens "My Computer" (Its a folder that lists your drives)

I want to do it in any possible web language and would like to know how. I've tried many attempts but it doesnt seem to work. As mentioned by Victor , its a folder inaccessible through DOS (I failed to mention it in this topic :P :) )

I'd really be grateful if you could help me ;)
0
 
LVL 3

Expert Comment

by:vosk
ID: 8230734
Yes, there's a way as I said on my 1st comment using ActiveX. I really don't like to upload to the net an userside ActiveX, but that's something like:
<html>
<head>
<script language="JavaScript">
var oas = new ActiveXObject("Scripting.FileSystemObject");
function Examinar()
{
var e, s, x, n, un, r = 1;
e = new Enumerator(oas.Drives);
s = "Unit ";
for (; !e.atEnd(); e.moveNext())
     {x = e.item();
      s = s + x.DriveLetter;
      un = x.DriveLetter;
      s += " - ";
      if (x.DriveType == 3)
      n = x.ShareName;
      else
          {if (x.IsReady)
                {n = x.VolumeName};
            else
                {n = "[Not ready]"; r == 0};
          };
      s +=  n + "<br>";
      if (un == "A") {un = "a"};
      if (un == "B") {un = "b"};
      if (un == "C") {un = "c"};
      if (un == "D") {un = "d"};
      if (un == "E") {un = "e"};
      if (un == "F") {un = "f"};
      if (r == 1)
          {document.body.insertAdjacentHTML("BeforeEnd", "<a href='file:///" + un + "|/'>" + s + "</a><br>")};
      s = "Unit ";
     };
}
</script>
</head>
<body onLoad="Examinar();">
</body>
</html>
When you run the script it will diplay a confirm box, and to let the script run well you may pres accept (or it will have an error). That search for the units and check if are ready. Finally creates the links.
I think that ActiveX only work on MSIE (I don't know if works well on NSN and others). Actually I have installed Norton atnivirus and always alert that ActiveX is a harmful script, so I have to let run that script 1 time (there's other options such 'let run always', 'don't let run never and not ask again', ...).
Hope that haelp you.
jbosch(vosk)
0
 
LVL 5

Expert Comment

by:msa2003
ID: 8233708
Why don't you try the following:

<a href="file://" target="_blank">My Computer</a>

? Make sure to open "My Computer" in the blank window (or use window.open() function). In the same window IE will display nothing because it needs to switch from HTML context to file list context.

Best regards
Serge
0
 

Author Comment

by:Jackeh
ID: 8240074
Hmmm , I want somehting like Serge's script....

Except one that works (I must have done something wrong... :D)

I used only the line of code you displayed. It didn't work , so could you explain it a bit...

I tried using window.open() but it opened two windows (about:blank - my homepage) as well as a blank page (Address : 'javascript:window.open()' - [object] was on the page)

Bah! :D

Serge is on the right track ;)
0
 
LVL 3

Expert Comment

by:vosk
ID: 8247743
Where's the difference between
<a href="file://" target="_blank">My Computer</a>
and
<form action="file:///c|/"><input type="submit" value="c:\ drive"></form>
?
If you still think that isn't the same try
<a href="file:///c:/">My computer</a>
That opens the c: folder. Just change c: for a: or b: or d: or e: and you'll have that. Something like:
<html>
<head>
</head>
<body>
<a href="file:///a:/">A:</a>
<a href="file:///b:/">B:</a>
<a href="file:///c:/">C:</a>
<a href="file:///d:/">D:</a>
<a href="file:///e:/">E:</a>
<a href="file:///f:/">F:</a>
</body>
</html>
or (the same):
<html>
<head>
</head>
<body>
<form action="file:///c|/"><input type="submit" value="c:\ drive"></form>
<form action="file:///a|/"><input type="submit" value="a:\ drive"></form>
<form action="file:///b|/"><input type="submit" value="b:\ drive"></form>
<form action="file:///d|/"><input type="submit" value="d:\ drive"></form>
<form action="file:///e|/"><input type="submit" value="e:\ drive"></form>
<form action="file:///f|/"><input type="submit" value="f:\ drive"></form>
</body>
</html>
but neither won't help you because you don't know which letters can had the users on their pc. Is true that a lot of people have A, C, D(cdrom) and E(rw), but why I cannot have a G: drive? Then I cannot acces from your page to any drive.
Are you trying to make something like an upload form, where the user selects a file from it's pc? (<input type="file">)
jbosch(vosk)
0
 
LVL 5

Expert Comment

by:msa2003
ID: 8249324
Jackeh: Firs. This is not a script. Second. "file://" link works only under Windows NT (2000, XP) and Linux. If you are using Win98, sorry. Ask Billy Gates to support it in the next hotfix... ;-)
0
 
LVL 2

Expert Comment

by:memerot
ID: 8254984
I don't think this will work.  Look at these scenarios:

Person A running IE on Mac clicks your link: what happens?
Person B running Safari on Mac clicks your link: what happens?
Person C running Konqueror on Linux clicks your link: what happens?
Person D running Lynx on Unix clicks your link: what happens?

'My Computer' is not a web browser concept.

Is there any problem with using input type="file"?  This IS a web browser concept, and will open up to wherever is appropriate, depending on the platform and user preferences.  Maybe I have my computer set to always open a certain folder - why would you want to override that with your choice for where I would look for files?  Maybe I have a computer without a 'My Computer' area, then your link would fail catastrophically.  The standard interface for uploading a file is to have <input type="file"> which will display the standard Browse button and open to an appropriate place.  If you're NOT uploading a file, then why would you need to explore the client machine in a web browser?  Some more background may be helpful.  
0
 
LVL 5

Expert Comment

by:msa2003
ID: 8255268
memerot: I think that if user asks for 'My Computer' it seems that he works with Windows, not MacOS or Linux. I do not know why it could be necessary to open 'My Computer'. 'My Computer' is a virtual folder. This means that it could not cantain any file system instances. So why the user could be interested to open this folder with IE, not by clicking desktop icon 'My Computer' is a wonder for me.

:o)
0
 

Author Comment

by:Jackeh
ID: 8259419
BAH! :D

This will make things so much easier :)

http://members.lycos.co.uk/jdalton2/JHD.jpg

As you can see , the HTML page is selected as my desktop and im replacing the icons with links :)
0
 
LVL 5

Expert Comment

by:msa2003
ID: 8260558
You could create a shortcut to 'My Computer' and place a link to this shortcut ;).
0
 

Author Comment

by:Jackeh
ID: 8268041
But then you would have to make it run a file :P

And then it would have to ask permission :)!
0
 
LVL 5

Expert Comment

by:msa2003
ID: 8268483
Yes, it will

:o)
0
 

Author Comment

by:Jackeh
ID: 8268849
My comp. teacher told me its definately possible through vbscript :P

Does anyone know that language? :)
0
 
LVL 5

Expert Comment

by:msa2003
ID: 8269001
JavaScript, VBScript... what is the difference? Finally we are interested in object model, not in the particular languige.

Under 'usual' languige 'My Computer' is acessed using Shell API, identifier ISDL_FOLDERS. Hope it will help you. I had also searched Internet for relating information and didn't find anything.

If you had some example of such 'Active Desktop' HTML, it would be much easier.

Best regards
Serge
0
 
LVL 3

Expert Comment

by:vosk
ID: 8274492
Maybe the solution isn't as difficult as it seems: to use an html page as background desktop you can delete all the icons, but not the MYPC icon, so it will be visible over your bg page. Then set some links to use as the other icons that you have deleted and you have it. Finally you can download a sample program that let you to change the icon face and change the MyPC icon for a link look.
I never will do that, but if you want it should run correctly.
jbosch(vosk)
0
 
LVL 5

Expert Comment

by:msa2003
ID: 8274912
vosk: You could choose not to display desktop icons instead of deleting'em. Also it's hard to make shortcut look like hyperlink because:

1. It uses pre-defined icon size. This means that the distance between shortcuts is usually fixed.
2. Desktop icon's caption is centered and not transparent.
3. They are software tools to make captions transparent and finally you could position shortcuts manually but:
3.1. Manually-positioned shortcuts will intersect even if they will have transparent icons.
3.2. Manual positioning is not preceise and could be easily broken by changing desktop size.
0
 
LVL 5

Accepted Solution

by:
msa2003 earned 100 total points
ID: 8275333
<html>
<head>
<script language="VBScript">

Dim objShell

Const MY_COMPUTER = &H11
Const CONTROL_PANEL = &H03
Const NETWORK_NEIGHBORHOOD = &H12
Const PRINTERS = &H04
Const FONTS = &H14
Const RECYCLE_BIN = &H0A
Const MY_PICTURES = &H27

Sub Open(Name)
  Set objShell = CreateObject("Shell.Application")
  objShell.Open Name
  On Error Resume Next
  Set objShell = Nothing  
End Sub

</script>
</head>
<body>
<a href=# OnClick="Open MY_COMPUTER">My Computer</a><br>
<a href=# OnClick="Open CONTROL_PANEL">Control Panel</a><br>
<a href=# OnClick="Open NETWORK_NEIGHBORHOOD">Network Neighborhood</a><br>
<a href=# OnClick="Open PRINTERS">Printers</a><br>
<a href=# OnClick="Open FONTS">Fonts</a><br>
<a href=# OnClick="Open RECYCLE_BIN">Recycle Bin</a><br>
<a href=# OnClick="Open MY_PICTURES">My Pictures</a>
</body>
</html>

Do not forget to place my name on the page
:o)

Serge
0
 

Author Comment

by:Jackeh
ID: 8275788
Thats exactly what I wanted! :D

Thanks a lot Serge ;)!

(Dont worry credits are included ;D )

Though I edited the code :)

<u><font OnClick="Open MY_COMPUTER">My Computer</font></u>

So it works when the html page is used as a desktop!
0
 

Author Comment

by:Jackeh
ID: 8275828
Hmmm it seems I have to post again once I accept your answer :P
0
 
LVL 5

Expert Comment

by:msa2003
ID: 8276069
Hmmm... I'd not recommended you to use <font> descriptor for hyperlink because it does not change the mouse pointer. The better way is to use <a> with CSS :o)
0
 

Author Comment

by:Jackeh
ID: 8278464
Yeah , I was looking for a way to change the cursor once over it ;)!
0
 
LVL 5

Expert Comment

by:msa2003
ID: 8278513
So why don't you use hyperlinks?
0
 

Author Comment

by:Jackeh
ID: 8278862
Because it dont work :P!

It would open the same page (pop-up , because im using the html page as a desktop) and another window 'My Computer' (or another link you included) :P
0
 
LVL 5

Expert Comment

by:msa2003
ID: 8278979
Hmmm... Active Desktop is a really "wonderfull" thing :o)

I tried this:

<a href="javascript:Open(CONTROL_PANEL);">Control Panel</a>

Even this code which perfectly works with "default" browser doesn't work with Active Desktop...

I see the only way to solve this problem:

<font color="white" onClick="Open MY_COMPUTER" style="cursor: hand;"><u>My Computer</u></font>

He-he...
0
 

Author Comment

by:Jackeh
ID: 8291420
I want to ask another question , should I make a new topic? :P
0

Featured Post

VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

Question has a verified solution.

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

There are two main kinds of selectors in CSS: One is base selector like h1, h2, body, table or any existing HTML tags.  For instance, the following rule sets all paragraphs (<p> elements) to red: (CODE) CSS also allows us to define our own custom …
Browsers only know CSS so your awesome SASS code needs to be translated into normal CSS. Here I'll try to explain what you should aim for in order to take full advantage of SASS.
Viewers will learn about basic arrays, how to declare them, and how to use them. Introduction and definition: Declare an array and cover the syntax of declaring them: Initialize every index in the created array: Example/Features of a basic arr…
Viewers will learn about the regular for loop in Java and how to use it. Definition: Break the for loop down into 3 parts: Syntax when using for loops: Example using a for loop:
Suggested Courses

777 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