how to link to a local resource like "my computer"?

dualblade

Supreme [H]ardness
Joined
Nov 19, 2000
Messages
4,180
i'm looking to use a web page as a desktop, so this programming question only covers a local scope (not being accessed by any other machines). i want to use an image map as my desktop, and have different parts of the image link to different things. this will provide an uncluttered way to link to alot of things. i can link to drives and files just fine, but how do you link to something like "my computer" or "my network places", which don't really have a set location on the hard drive?

thanks
 

inotocracy

Supreme [H]ardness
Joined
Jul 25, 2004
Messages
5,625
I know executing "file://" will display the My Computer view/dialog. But I dont quite understand what your asking.
 

Wiseguy2001

2[H]4U
Joined
Nov 28, 2001
Messages
3,466
Whatsisname said:
what happens if you just do <a href="My Computer">blah</a>

URL's dont have spaces. You can use 'localhost', or if you are doing allot of development work on your local machine and typing localhost all the time is too difficult/time consuming you can add an entry to your hosts file and use a keyword such as 'me'.
 

dualblade

Supreme [H]ardness
Joined
Nov 19, 2000
Messages
4,180
Wiseguy2001 said:
URL's dont have spaces. You can use 'localhost', or if you are doing allot of development work on your local machine and typing localhost all the time is too difficult/time consuming you can add an entry to your hosts file and use a keyword such as 'me'.

is there a way to use localhost to accomplish what i'm trying to get? my problem is that you can't href="my computer". the quotes take care of the spaces issue, but my computer is not a real place so i don't think you can directly link to it like that. a real place being something like href="c:\" (which would open up the root of the drive) or href="c:\text.txt", which would directly link to a file. there's no actual file or folder called my computer, so i'm not sure how to link to it. how is my computer opened in the first place? is it a script that assembles the window on the fly?

EDIT: perhaps an easier question to answer. i can just make a shortcut to my computer (.lnk file), and do a href="mycomputer.lnk". this prompts me to save or open the file. if i open it, it opens my computer (as i had wanted it to). is there a way to skip that prompt and have the default action be open?
 

Shadow2531

[H]ard|Gawd
Joined
Jun 13, 2003
Messages
1,670
right-click on "My Computer" and create a shortcut of it. Name it mycomputer.

Put it somewhere. (using c:\ for an example)

Code:
<a href="file://localhost/c:/mycomputer.lnk">My Computer</a>

Then, IE will ask you if you want to open the lnk file. You choose yes and MyComputer will open.

You should then *somehow* be able to make it open lnk files without asking. You might be able to do that by possibly tweaking the file extension association to automatically open lnk files without asking. However that might be a risk. You might have to edit the registry to make it happen.

Also, c:\windows\explorer.exe will work in the href no problem. If you can set explorer.exe to open at MyComputer by default (via the registry or something), then you'd be all set.
 

dualblade

Supreme [H]ardness
Joined
Nov 19, 2000
Messages
4,180
i know there's a set of commands you can give explorer to open up different things like recycle bin, network places, and my computer. i'm having trouble coming up with the right syntax for the link, but i think that's a good avenue to pursue so i'm gonna keep at it. if anyone knows how to do it, let me know; otherwise, thanks for the advice
 

Shadow2531

[H]ard|Gawd
Joined
Jun 13, 2003
Messages
1,670
At first I tried using clsid:{number} in the link (since special folders etc use them), but that didn't work.
 

dualblade

Supreme [H]ardness
Joined
Nov 19, 2000
Messages
4,180
if anyone's interested, i did manage to find some code that will allow .lnk files to execute without prompting. this lets you link to pretty much any folder, file, or page.

here's what i've got so far as a desktop. i think it came out pretty good, but i'm still looking for little things to add to it:

desktop.jpg
 

G-daddy

2[H]4U
Joined
Feb 8, 2001
Messages
3,198
dualblade said:
if anyone's interested, i did manage to find some code that will allow .lnk files to execute without prompting. this lets you link to pretty much any folder, file, or page.

here's what i've got so far as a desktop. i think it came out pretty good, but i'm still looking for little things to add to it:
img]http://s89429015.onlinehome.us/desktop.jpg[/img]

Can you post the html
 

Thor

2[H]4U
Joined
Jul 23, 2001
Messages
3,882
Code:
<a href="file://localhost/c:/windows\explorer.exe /n, /e, /select, c:\   ">My Computer</a>

c:/windows\explorer.exe /n, /e, /select, c:\

works from a command line, but i cant seem to get it to work for html thought i havemt played that much with it

Explorer.exe /e,/root,c:\ will display c: root, replace with the drive letter you want you can use Explorer.exe /e,c:\ to change the layout this will open the window with ONLY the c drive visible on the list the other drives dont show

have fun

thore
 

dualblade

Supreme [H]ardness
Joined
Nov 19, 2000
Messages
4,180
i've only got a sec now, so i'll post a link to the run anything code:

http://www.osnn.net/articles.php?action=show&showarticle=47#programlaunch

the info there applies to running a .vbs file, but it doesn't have to be changed for a .lnk file.

this is the actual implementation of the script

<a onClick="exec('somelink.lnk'); return false;" href="javascript:void(0)">Launch Solitare</a>

the only catch is that the .lnk files have to be in your path (it explains this on the page), so you have to update your path to include the folder where you decide to keep all your shortcuts.
 

dualblade

Supreme [H]ardness
Joined
Nov 19, 2000
Messages
4,180
thore said:
that would be southern hobo spanish for "thank you"

:D

thore

lol, ok. i'm not southern, spanish, or a hobo so i was trying to figure out if it was some new and creative way to call me a homo
 

G-daddy

2[H]4U
Joined
Feb 8, 2001
Messages
3,198
dualblade said:
lol, ok. i'm not southern, spanish, or a hobo so i was trying to figure out if it was some new and creative way to call me a homo
What he said ^^

Grassyass.. Gracias... meh. :)
 
Top