|
South Africa4316 Posts
|
Well "file:///C:/" would be the proper way of doing it, but that would still open it in the browser and not explorer.exe.
The only way I could think of doing it is to somehow write some javascript code that opens "c:\windows\explorer.exe" with the argument "c:\" when you click on a certain link but my javascript is very rusty so I'm unsure of how to do this (or if you even can do this - maybe in java or php).
|
script:
<script language="javascript"> function openLink() { var shell = new ActiveXObject("WScript.shell"); if (shell) { shell.run("C:\\windows\\explorer.exe D:"); } else { alert("Error"); } } </script>
to invoke:
<a href="#" onClick="openLink()">asdf</a>
|
South Africa4316 Posts
Thanks for the replys, I'm sorry I couldn't respond as I went to bed early last night with a cold.
zdd, the complete code looks like this at the moment:
<html> <html> <head> <style> body { background-image: url(4.jpg); } #links { margin-left: 1331px; margin-top: 665px } .link { margin-bottom: 6px; } .link a { display: block; width: 45px; height: 45px; } </style><body> </style></head>
<script language="javascript"> function openLink() { var shell = new ActiveXObject("WScript.shell"); if (shell) { shell.run("C:\\windows\\explorer.exe D:"); } else { alert("Error"); } } </script>
</head> <body> <div id="links"> <div class="link"><a href="C:\Pics\Photoshop\HTML\h.lnk"></a></div> <div class="link"><a href="C:\Pics\Photoshop\HTML\c.lnk"></a></div> <div class="link"><a href="#" onClick="openLink()"></a> </div> <div class="link"><a href="C:\Pics\Photoshop\HTML\g.lnk"></a></div> </div> </body> </html>
Sorry if there are any mistakes, my knowledge of html coding is very very minimal. When I click on the link (3rd one, since the script only leads to d drive at the moment), it tells me active-x will be activated, and if I say yes, nothing seems to happen. Any idea how to make it not ask me about active-x constantly, and why nothing happens?
|
South Africa4316 Posts
Also, the idea I'm playing with atm is to create a new file type (.ink), which will work in the same way as shortcuts (.lnk), but will be set up so that windows does not ask whether to download the file first. Now, I know how to create a shortcut, and I know how to stop windows from asking if you want to download the file, but when you create a shortcut then the "advanced" button doesn't exist.
I think this will be possible if I could somehow find a list of commands available for the "actions" menu, but I just can't seem to find such a list. I'm thinking that perhaps a command such as "browse" or "browse file location" or such a command could be used to make it work.
|
South Africa4316 Posts
Actually, I think I've gotten this to work. Your script worked perfectly zdd, I was just being a retard (my explorer.exe is on my e: drive). To turn of the notifications, you just change the security settings for files on the "local intranet". So as things are at the moment, I can access my D drive like it is. I'm going to copy your script three times, give it a new name (openLink2 etc.), and hopefully that will work!
Thank you everybody!
|
South Africa4316 Posts
Final code:
<html> <html> <head> <style> body { background-image: url(4.jpg); } #links { margin-left: 1331px; margin-top: 665px } .link { margin-bottom: 6px; } .link a { display: block; width: 45px; height: 45px; } </style><body> </style></head>
<script language="javascript"> function openLinkC() { var shell = new ActiveXObject("WScript.shell"); if (shell) { shell.run("E:\\windows\\explorer.exe C:"); } else { alert("Error"); } } </script>
<script language="javascript"> function openLinkD() { var shell = new ActiveXObject("WScript.shell"); if (shell) { shell.run("E:\\windows\\explorer.exe D:"); } else { alert("Error"); } } </script>
<script language="javascript"> function openLinkG() { var shell = new ActiveXObject("WScript.shell"); if (shell) { shell.run("E:\\windows\\explorer.exe G:"); } else { alert("Error"); } } </script>
<script language="javascript"> function openLinkH() { var shell = new ActiveXObject("WScript.shell"); if (shell) { shell.run("E:\\windows\\explorer.exe H:"); } else { alert("Error"); } } </script>
</head> <body> <div id="links"> <div class="link"><a onClick="openLinkH()"></a> </div> <div class="link"><a onClick="openLinkC()"></a> </div> <div class="link"><a onClick="openLinkD()"></a> </div> <div class="link"><a onClick="openLinkG()"></a> </div> </body> </html>
|
So ugly code... use this please
<html> <head> <script language="javascript"> function openLink(path) { var shell = new ActiveXObject("WScript.shell"); if (shell) { shell.run("E:\\windows\\explorer.exe " + path); } else { alert("Error"); } } </script> <style> body { background-image: url(4.jpg); } #links { margin-left: 1331px; margin-top: 665px } .link { margin-bottom: 6px; } .link a { display: block; width: 45px; height: 45px; } </style> </head> <body> <div id="links"> <div class="link"><a onClick="openLink('H:')">h:</a> </div> <div class="link"><a onClick="openLink('C:')">c:</a> </div> <div class="link"><a onClick="openLink('D:')">d:</a> </div> <div class="link"><a onClick="openLink('G:')">g:</a> </div> </body> </html>
But... while this works, it's not really cool. 2 problems:
1. It uses ActiveX. You have to configure IE to not display any warnings when he's about to execute ActiveX code, otherwise you always get an annoying confirmation window. Doing so will probably make IE much less safe for browsing the web though.
2. The desktop is always covered by windows anyway. I'd recommend totally ignoring the desktop and instead following an approach like this: http://avesh.com/blog/DesktopZenReducingVisualClutterOnYourDesktop.aspx I also have 3 additional toolbars in my taskbar, D, A and G (directories, apps and games) containing shortcuts to everything I need. This is much faster than switching to the desktop back and forth constantly. Downloads are saved in a special directory 'downloads' accessible via the 'D' menu then. All that's on my desktop is a wallpaper and that's it. Much faster this way. The taskbar is always there, the desktop isn't.
|
South Africa4316 Posts
Deadbeef, I don't display any icons on my desktop or have any start menu icons. I've mastered the art of reducing cluster. To run applications I have keyboard shortcuts for almost all applications (ctrl+alt+e for browser, ctrl+alt+w for music player, ctrl+alt+a for mirc etc. etc.), and for the very few applications I don't have shortcuts, I usually use the run command (windows+r --> c:\applications\d-tools\daemon.exe). Using hotkeys like this is much faster than using taskbars, and in fact, I hate taskbars only slightly less than desktop icons- still way too much clutter!
Switching to the desktop is very easy using windows+d, so it's not a problem for me. I used to go windows+r --> d: --> enter (which I can do to navigate to any drive in comfortably under a second), which I still often do, but if my keyboard is out of reach I like to have it easily accessible. Also, I dual screen, so my one desktop is often open, or if not completely open, it's rarely got more than one window maximised over it.
As to the active-x, you don't disable notifications completely, only for files on the local computer. So it's only disabled for files saved on my computer, which is only my wallpaper script. Doesn't really affect browsing security.
All in all, I think you may misunderstand one of the main reasons my background is an html page with buttons: the fun of creating it. Since I've become decent enough with photoshop to actually use my own pictures as wallpapers, I never use wallpapers, but always make myself some form of customized wallpaper. This time I went for a nice colourful but basic wallpaper. Part of the fun for me is to create awesome new buttons for my wallpaper, that actually improves the look of the wallpaper, rather than causing clutter. I really enjoy this part of the wallpaper creation. So even if it wasn't the most practical tool ever, I'd still enjoy making the buttons, although I wouldn't be able to stand having them there if they had no function whatsoever.
Thanks for the toned down html-code though, I knew my code was very bulky, but I'm not nearly good enough to tone it down myself. In fact, I wrote very little of that code, and even now I still ask for some hints from sonuvbob (whose computer I broke on this desktop project), when changing the code.
|
Ok then that's fine... We have very similar usage habits. I'm just not starting programs via keyboard shortcuts. Well, not in Windows, that is. In Linux I do.
|
if you want to run programs with win+r (something i do pretty much all the time) put a shortcut in the default windows directory (usually C:\windows) saves you from having to type the path, so if your shortcut for daemon is called dae, all you do is winR -> dae
|
South Africa4316 Posts
That's an awesome tip JeeJee, I think I'll make use of that thanks
|
South Africa4316 Posts
I've got a new challenge for you guys, and I'd love some help on this. Would it be possible to have a button that will change the picture every time I click on it? For instance, an arrow button that I can click up that will scroll through the pictures (1.jpg, 2.jpg, 3.jpg) etc? Of course, if that's not possible (or atleast too much effort, then simply a button that will change the wallpaper to a selected picture will help (then I can create 10 2x2 buttons placed next to each other, creating a big "random" button)
Once again, any help on this will be appreciated!
|
Sorry my internet died
Anyway, here's what I came up with:
<script language="JavaScript"> var pic_index = 0; var pictures = new Array ("1.png","2.png", "3.png"); function changeImage(direction) { pic_index += direction; if (pic_index > -1 && pic_index < pictures.length){ document.getElementById('picture').innerHTML = '<img src="'+pictures[pic_index]+'">'; } } </script> <table width=100%><tr><td><span id="picture"><img src="1.png"></span></td></tr></table> <a href = "#" onClick='changeImage(-1)'>Prev Pic</a> <a href = "#" onClick='changeImage(1)'>Next Pic</a>
|
South Africa4316 Posts
Current code:
<html> <html> <head> <style>
#links { margin-left: 1331px; margin-top: 665px } .link { margin-bottom: 6px; z-index: 2; } .link a { display: block; width: 45px; height: 45px; }
#buttons { margin-left: 1229px; margin-top: 153px } .button { margin-left: 6px; z-index: 2; } .button a { display: block; width: 45px; height: 45px; }
</style><body> </style></head>
<script language="javascript"> function openLinkC() { var shell = new ActiveXObject("WScript.shell"); if (shell) { shell.run("E:\\windows\\explorer.exe C:"); } else { alert("Error"); } } </script>
<script language="javascript"> function openLinkD() { var shell = new ActiveXObject("WScript.shell"); if (shell) { shell.run("E:\\windows\\explorer.exe D:"); } else { alert("Error"); } } </script>
<script language="javascript"> function openLinkG() { var shell = new ActiveXObject("WScript.shell"); if (shell) { shell.run("E:\\windows\\explorer.exe G:"); } else { alert("Error"); } } </script>
<script language="javascript"> function openLinkH() { var shell = new ActiveXObject("WScript.shell"); if (shell) { shell.run("E:\\windows\\explorer.exe H:"); } else { alert("Error"); } } </script>
<script language="JavaScript"> var pic_index = 0; var pictures = new Array ("1.jpg","2.jpg", "3.jpg"); function changeImage(direction) { pic_index += direction; if (pic_index > -1 && pic_index < pictures.length){ document.getElementById('picture').innerHTML = '<img src="'+pictures[pic_index]+'">'; } } </script>
</head> <body> <div style="position: absolute; left: 0px; top: 0px; height: 900px; width: 1440px; padding: 0 z-index:1;"><span id="picture"><img src="1.jpg"></span></div>
<div id="links"> <div class="link"><a onClick="openLinkH()"></a> </div> <div class="link"><a onClick="openLinkC()"></a> </div> <div class="link"><a onClick="openLinkD()"></a> </div> <div class="link"><a onClick="openLinkG()"></a> </div></div>
<div id="buttons"> <div class="button"><a onClick='changeImage(-1)'></a></div> <div class="button"><a onClick='changeImage(1)'></a></div> </div>
</body> </html>
(Still bulky, will tone it down soon deadbeef!)
|
South Africa4316 Posts
|
Adding on to what JeeJee said:
I do a similar thing for that, except I added made a folder called e:\xhuwin\paths and added that to the system path. I have all my shortcuts in there. This way, you don't have to go to the windows directory every single time you want to update your shortcuts, and they're not all cluttered with the windows files.
Also, for those who like customization, I use two programs: strokeit and autohotkey. Strokeit gives you mouse gestures so I can basically open any program in a single gesture, and autohotkey is an incredibly flexible tool that can basically create any hotkey in windows you want. You should give them a try.
For example, I have hotkeys that ... automatically open my different drives, my music / pictures / documents, computer, starcraft / firefox / winamp / pidgin, insert the current date / time, and an alt-tab replacement with my scroll wheel (I push down on the middle button and it acts as alt tab when i scroll). Very nifty,
And for mouse gestures I have maximize / minimize window with a single flick, close windows, etc.
|
|
|
|