Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

I'm running AutoHotkey 1.0.48.05 on Windows 7 (64 bit).

I'd like CTRL-ALT-T to open the command prompt (such that it has the same Path / capabilities as when I open the command prompt manually).

This is what I have so far:

^!t::
    Run, cmd /k
Return

This successfully opens the command prompt, but it doesn't seem to have the %PATH% variable that I'd have if I go to Start > Run ... > cmd.exe.

For example, if I do CTRL-ALT-T and then type "java", I get:

'java' is not recognized as an internal or external command, operable program or batch file.

But if I use the Start > Run method, java works.

share|improve this question
    
Where you have put the script file of AHK? Try to put it in the same path as open through the Run –  avirk Sep 25 '12 at 7:05
    
I don't know what this means. I have the default file location: C:\Users\{user}\Documents\AutoHotkey.ahk And then that file does nothing other than an #Include of a file somewhere else. (I'm doing this to make it easier for my coworkers to share scripts.) –  Ryan Sep 25 '12 at 20:26
    
Strange. You aren't opening an elevated prompt, are you? –  surfasb Sep 26 '12 at 0:11
    
Try to put it in the C:` drive and then execute it. As I mean when we run the cmd` from RUN command then it ioen the command prompt window with the path C:\user\username> and if you have put the AHK in the path C:\Users\{user}\Documents` then it will open it. So try to put in the location from where you execute the Java`. Hope I'm clear now. –  avirk Sep 26 '12 at 0:39

2 Answers 2

Have you tried this?

^!t::Run, %comspec% /k

In any case, you can check the path by just typing PATH.

share|improve this answer
    
doesn't help, unfortunately –  Ryan Sep 25 '12 at 17:21

I wrote the following script and it works perfectly on my system:

^!t::
    Run %WINDIR%\System32\cmd.exe /k
return

If you initially want to be in an specific folder (instead of AutoHotKey's installation folder) you can use "cd" command. For example, with the following script your command prompt will start in your Home folder:

^!t::
    Run %WINDIR%\System32\cmd.exe /k cd %USERPROFILE%
return

You can replace %USERPROFILE% with your desired destination folder.

share|improve this answer
    
Unfortunately this doesn't behave differently... same problem. Cool suggestion about the USERPROFILE though. –  Ryan Sep 26 '12 at 18:56

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.