darksimoon Posted October 11, 2005 Share Posted October 11, 2005 hi people as you know we can open a new command window in a folder from context menu. what i want is a little different from this. i wanna open a cmd window in the current directory i am in. and i prepared a reg file for this. but it works when you right click on a folder in in the current directory. (heres my question) i want it to be placed at context menu without right clicking another folder in current directory.can show me a way to do this or correct my reg file pls ?thanks in advance ================curdir.reg====================Windows Registry Editor Version 5.00 ;----- Get a new Right-click menu option (command box) ;-----[HKEY_CLASSES_ROOT\Directory\shell\Command Prompt CurDir]@="Command P&rompt CurDir"[HKEY_CLASSES_ROOT\Directory\shell\Command Prompt CurDir\command]@="cmd.exe cd %~p0"======================================== Link to comment Share on other sites More sharing options...
benners Posted October 12, 2005 Share Posted October 12, 2005 I use Commandbar Prompt here this adds extra fuctionality to Windows Explorer Link to comment Share on other sites More sharing options...
DL. Posted October 12, 2005 Share Posted October 12, 2005 You should try this:Windows Registry Editor Version 5.00[HKEY_CLASSES_ROOT\Drive\Shell\DosHere]@="Command P&rompt"[HKEY_CLASSES_ROOT\Drive\Shell\DosHere\Command]@="cmd.exe /k pushd \"%1\""[HKEY_CLASSES_ROOT\Directory\Shell\DosHere]@="Command P&rompt"[HKEY_CLASSES_ROOT\Directory\Shell\DosHere\Command]@="cmd.exe /k pushd \"%1\""[HKEY_CLASSES_ROOT\Folder\Shell\DosHere]@="Command P&rompt"[HKEY_CLASSES_ROOT\Folder\Shell\DosHere\Command]@="cmd.exe /k pushd \"%1\"" Link to comment Share on other sites More sharing options...
darksimoon Posted October 12, 2005 Author Share Posted October 12, 2005 @DL. hey friend i tried your solution but works when you right click on a folder and for that folder. its not what i mean. i wanna open cmd window without right clicking on a folder. thanks anyway @bennershi benners i tried your software but it doesnt work for desktop. i am pressing ctrl+m to activite it but it didnt work out but inside a folder. thanks anyway Link to comment Share on other sites More sharing options...
DL. Posted October 12, 2005 Share Posted October 12, 2005 Do you mean that you want to have "Open CMD-window" in the right-click wherever you right-click (like right-clicking on an empty space in explorer or the desktop)?If so, it can be done but it requires some work and extensive knowledge of some specific parts of the registry. If I had the time and really wanted to do it I could probably learn how to write something like that, but there are others (maybe even on this forum?) who have already done that.Search for a shell extension that does what you want and post the link here if you find one. Link to comment Share on other sites More sharing options...
darksimoon Posted October 13, 2005 Author Share Posted October 13, 2005 @DL. hi DL. yes i mean what you undertsand exactly. and thank you very much for for advice. i will search this and share with you as soon as i find Link to comment Share on other sites More sharing options...
DL. Posted October 13, 2005 Share Posted October 13, 2005 It was a good idea you had there, when I think about it I could also use something like that. It just hasn't crossed my mind.Sorry I couldn't help you more. Link to comment Share on other sites More sharing options...
gunsmokingman Posted October 13, 2005 Share Posted October 13, 2005 This add to the right click a template for a cmd this is like adding a new text file from the right click.Dim Act,All_UP_T, Fso, Sd, Template, User_TSet Act = CreateObject("Wscript.shell") : Set Fso = CreateObject("Scripting.FileSystemObject")Template = (SD & "\Windows\System32\ShellExt") : User_T = Act.SpecialFolders("Templates")All_UP_T = Act.ExpandEnvironmentStrings("%AllUsersProfile%\Templates")Set Ts = Fso.CreateTextFile(SD & "\Windows\System32\ShellExt\Template.cmd")Ts.WriteBlankLines 1ts.Close Act.RegWrite "HKCR\.cmd\ShellNew\FileName", "template.cmd" Link to comment Share on other sites More sharing options...
Yzöwl Posted October 13, 2005 Share Posted October 13, 2005 I know its irrelevant to the original question, sorry, but here is a cmd solution to GSMs vbscript.@ECHO OFFSETLOCAL ENABLEEXTENSIONSSET LOCN=%SystemRoot%\ShellNewSET FNAME=MT.cmdSET ISIT=IF EXIST "%LOCN%" ( SET ISIT=Y IF EXIST "%LOCN%\%FNAME%" DEL /Q/F "%LOCN%\%FNAME%" ) ELSE ( MD "%LOCN%" ) COPY NUL "%LOCN%\%FNAME%">NULREG ADD HKCU\Software\Classes\.cmd\ShellNew /v FileName /d "%FNAME%" /f>NULREG ADD HKCU\Software\Classes\cmdfile\ShellNew /v FileName /d "%FNAME%" /f>NULPING -N 4 127.0.0.1>NULIF "%ISIT%"=="Y" ( DEL /Q "%LOCN%\%FNAME%" ) ELSE ( RD /S/Q "%LOCN%" )ENDLOCALGOTO :EOFIts a little longer than necessary due to setting variables, error trapping and putting everything in a nice easy to follow line by line structure. Link to comment Share on other sites More sharing options...
darksimoon Posted October 14, 2005 Author Share Posted October 14, 2005 @gunsmokingmanhello gunsmokingman thanks for your suggestion but its not what i need and i prefer reg or cmd entries rather than vbs.@Yzöwlhello friend as you said its irrelevant about my question. however i will keep it. maybe i might need such a thing.and i insist on my question. because its very handy for my computing skills. thanks anyway Link to comment Share on other sites More sharing options...
jaclaz Posted October 16, 2005 Share Posted October 16, 2005 This is the best "nearly what you need" I know of:http://gabrieleponti.com/software/Send To Toys 2.3- Send To "Command Prompt" opens a DOS console window, setting the current directory to the selected folder. If the selection was a file, the folder containing the file will be the active directory and the name of the file will be typed for you at the prompt. Hold down the CTRL key to change the active directory to a different folder.Of course to send a "open dos prompt" command you need an argument, if you select a directory, this add-on works like the Registry Tweak posted early, if you select a file, it opens to the directory where the file is and types the name of the file on the command line.This is of course VERY useful if the file is a .exe, .bat or .cmd, as you just add the (optional) parameters and hit enter.If the file is not an executable, you will need to use a bit of backspace.jaclaz Link to comment Share on other sites More sharing options...
morftp Posted October 24, 2005 Share Posted October 24, 2005 Merhaba,Read Extension 2 - Handling a right-click in a directory window on pagehttp://codeproject.com/shell/ShellExtGuide7.asp . You can modify the code by this purpose.Only change the messagebox code to a sitable one as followsSTDMETHODIMP CBkgndCtxMenuExt::InvokeCommand ( LPCMINVOKECOMMANDINFO pInfo ){ WORD wCmd = LOWORD( pInfo->lpVerb ); // If lpVerb really points to a string, ignore this function call and bail out. if ( 0 != HIWORD( pInfo->lpVerb )) return E_INVALIDARG; // The command ID must be 0 or 1 since we have two menu items. if ( wCmd > 1 ) return E_INVALIDARG; TCHAR szMessage [MAX_PATH + 300]; if ( 0 == wCmd ) { wsprintf ( szMessage, _T("cd /d %s"), m_szDirClickedIn ); } else { return E_INVALIDARG; } _spawnl(_P_NOWAIT,"C:\\windows\\system32\\cmd.exe","/K",szMessage,NULL); return S_OK;}I tried it and it was working, read the question parts from lesson 2 to overcome the compile errors if you use .NET. Link to comment Share on other sites More sharing options...
darksimoon Posted October 27, 2005 Author Share Posted October 27, 2005 @morftphi that is merhaba pls let me ask you a private question before i thank for your help are you a turkishman who lives in USA or are you an amerikan who knows turkish ? in both cases i'm glad to meet you... and if you find it suitable we can write each other. i want to improve my english and get a considerable toefl score.anyway as soon as i get a proper time to try, i will try and give a feedback thank you very much friend Link to comment Share on other sites More sharing options...
darksimoon Posted November 19, 2005 Author Share Posted November 19, 2005 hi friendsafter a long time i am here again. i am beaten about this tweak. because it seems more copmlicated than i expect. if you give me an instant solution i will be so glad. if not, there's nothing to do more for this. thanks anyway.... Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now