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

DonationCoder.com Software > Unfinished Requests

IDEA: Get current directory

(1/4) > >>

Hawkbane:
I am running Windows XP Pro with Blackbox as my default shell. I wouldl like a way to be able to map my PF4 key to open a DOS command prompt in the current directory that I am in, as in Linux.  I have the hotkeys plugin, and I can map it to open cmd.exe, but I can't find a way to get the current dir to pass it as an argument.  Would it be possible to code an app that would do that for me?

mouser:
there are some addons to do this (right+click -> open dos box here) - though thats not really a hotkey.
it would be interesting to hear if anyone has an ideas of how to get the current directory in explorer; if so a macro tool or autoit might be able to do this.

many of us, including myself, use a windows explorer replacement which has buttons for things like "open dos box here" so that we don't need addons and stuff.  the existence of such buttons is one of the major reasons people use a file explorer replacement like powerdesk or directory opus.

Hawkbane:
I use an Explorer replacement as well, the free version of Xplorer2, and I do know about the context menu option Microsoft add on for 'open command prompt here'.  What I initially tried was copying the registry value of the context menu item into a shortcut, then passing the command prompt that shortcut as a value.  That works ... kind of.   It will get the context of the dir that the shortcut is in, not update and get the one where I currently am. 

I have asked around on several forums about this before, and have done a fair bit of searching throughout the Web.  General concensus is that everyone thinks it is possible, but no one knows how :) .  Hope one of you can help me.

mouser:
you could definitely achieve this easily with directory opus (but beware the price of dir. opus).
it will let you assign a hotkey to any button, so you could easily add a hotkey to the "command prompt here" button, which is what you are wanting.  does xpolorer2 maybe let you do this also?

skrommel:
 :) Here's a quick hack to solve the problem. It works in Explorer, but I don't know about Blakcbox.

OpenOther
Select files or folders in Explorer, press Ctrl-Enter to open the files in the programs you define below using extensions.

Download and install AutoHotKey from www.autohotkey.com. Save the script as OpenOther.ahk and doubleclick to run.

Skrommel



--- ---;OpenOther
;Select files or folders in Explorer, press Ctrl-Enter
; to open the files in the programs you define below using extensions.
;Skrommel @2005


;Extensions
;extension=command          Place a ` before commas
directory=cmd /k cd        ;Program to open directories
unknown=                   ;Program to open unknown or undefined extensions
empty=Notepad              ;Program to open files without extensions
txt=Write                  ;Program to open .txt-files
wri=Write
dll=Notepad
                           ;Add your own extensions here


;Program
^Enter::                   ;Hotkey Ctrl-Enter
Clipboard=
Send,^c
ClipWait,1
Loop,Parse,Clipboard,`n,`r
{
  SplitPath,A_LoopField,name,dir,ext,name_no_ext,drive
  FileGetAttrib,attrib,%A_LoopField%
  StringGetPos,dir,attrib,D
  If dir=0
    Run,%directory% %A_LoopField%
  Else
  {
    If ext=
      Run,%empty% %A_LoopField%
    Else
    {
      command:=%ext%
      If command<>
        Run,%command% %A_LoopField%
      Else
        If unknown<>
          Run,%unknown% %A_LoopField%
    }
  }
}
Return

Navigation

[0] Message Index

[#] Next page

Go to full version