Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 178
  • Last Modified:

Opening 'My Computer' Through Browser

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
Jackeh
Asked:
Jackeh
  • 11
  • 11
  • 6
  • +2
1 Solution
 
Victor_RCommented:
In the IE Address bar simply type "My Computer" and it should open it.
0
 
voskCommented:
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
 
voskCommented:
Another thing: can you be more explicit? Maybe they are other solutions to your problem instead accessing to 'My PC'...
jbosch(vosk)
0
What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

 
Victor_RCommented:
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
 
JackehAuthor Commented:
Hmmm

I tried that before....

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

Doesn't work :P :)

Any idea on how to fix it? ;)
0
 
Victor_RCommented:
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
 
voskCommented:
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
 
JackehAuthor Commented:
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
 
voskCommented:
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
 
msa2003Commented:
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
 
JackehAuthor Commented:
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
 
voskCommented:
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
 
msa2003Commented:
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
 
memerotCommented:
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
 
msa2003Commented:
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
 
JackehAuthor Commented:
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
 
msa2003Commented:
You could create a shortcut to 'My Computer' and place a link to this shortcut ;).
0
 
JackehAuthor Commented:
But then you would have to make it run a file :P

And then it would have to ask permission :)!
0
 
msa2003Commented:
Yes, it will

:o)
0
 
JackehAuthor Commented:
My comp. teacher told me its definately possible through vbscript :P

Does anyone know that language? :)
0
 
msa2003Commented:
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
 
voskCommented:
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
 
msa2003Commented:
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
 
msa2003Commented:
<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
 
JackehAuthor Commented:
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
 
JackehAuthor Commented:
Hmmm it seems I have to post again once I accept your answer :P
0
 
msa2003Commented:
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
 
JackehAuthor Commented:
Yeah , I was looking for a way to change the cursor once over it ;)!
0
 
msa2003Commented:
So why don't you use hyperlinks?
0
 
JackehAuthor Commented:
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
 
msa2003Commented:
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
 
JackehAuthor Commented:
I want to ask another question , should I make a new topic? :P
0

Featured Post

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

  • 11
  • 11
  • 6
  • +2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now