ATTENTION: You are viewing a page formatted for mobile devices; to view the full web page, click HERE.

DonationCoder.com Software > Post New Requests Here

DONE: DriveKeysAtoZ

<< < (2/4) > >>

app103:
ok...figured out how to get it to open in My Computer:


--- ---#e::Run ::{20d04fe0-3aea-1069-a2d8-08002b30309d}  ; Opens the "My Computer" folder.

:) Try adding /e,<path>.


--- ---#c:Run,Explorer.exe /e,C:\
#d:Run,Explorer.exe /e,D:\
#e:Run,Explorer.exe /e,E:\
Skrommel
-skrommel (April 23, 2007, 04:56 AM)
--- End quote ---

There has to be something better than 25 lines to handle this...no?

And what happens if I add a drive that doesn't exist and someone hits that key combo?

app103:
I seem to have filled my own request...with my first ahk script:



DriveKeysAtoZ:

Key combo of Right Ctrl + <letter from A to Z> will open Explorer to the root of that drive.

If you don't have a drive of that letter or if it is an empty removable media drive, it will tell you that you don't have a drive of that letter.

NOTE:
The combination of Right Ctrl and any other key will not work on 9x (sorry).
I am willing to change it if someone can come up with a better key to use instead of the Right Ctrl key. I only chose that one because it's least likely to conflict with any of my existing application hotkeys or my typing style.



Thank you jgpaiva and skrommel for your help.

Download it here.

AndyM:
Hi App103,

I've been meaning to do something like this when I got around to it.  Now I don't have to, very handy!

Some DonationCredits on the way...

Andy

skrommel:
 :) Very nice, App103! Here's a more compact version of your script.


--- ---#NoEnv
#SingleInstance,Force
SetBatchLines,-1

Loop,% Asc("Z")-Asc("A")+1
{
  drive:=Chr(Asc("A")+A_Index-1)
  Hotkey,RCtrl & %drive%,OPEN
}
Return

OPEN:
StringTrimLeft,drive,A_ThisHotkey,8
IfNotExist, %drive%:\
  TrayTip,,You do not have an %drive%: drive
Else
{
  TrayTip,,Exploring the %drive%: drive
  Run,Explorer.exe /e`,%drive%:\
}
Return

app103:
skrommel:

is there any reason why you used this:

--- ---Run,Explorer.exe /e`,%drive%:\

instead of this? (this is how it says to do it in the ahk help file)

--- ---Run,explore %drive%:\

Also, I had to get rid of those TrayTips...they make my very large hidden taskbar fly out halfway across the screen.

I would rather there be no message to the user at all when it is successful...just do what it is supposed to do and open it...and give a message box if it fails instead of a traytip.

new version with changes:


--- ---#NoEnv
#SingleInstance,Force
SetBatchLines,-1

Loop,% Asc("Z")-Asc("A")+1
{
  drive:=Chr(Asc("A")+A_Index-1)
  Hotkey,RCtrl & %drive%,OPEN
}
Return

OPEN:
StringTrimLeft,drive,A_ThisHotkey,8
IfNotExist, %drive%:\
  MsgBox You do not have an %drive% drive.
Else
{
  Run,explore %drive%:\
}
Return

Of course this compact version introduces one of the errors of English grammar that annoys me the most into the message box (a/an mis-usage).  :-[

Navigation

[0] Message Index

[#] Next page

[*] Previous page

Go to full version