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 am trying to display the current timestamp in the console dialog of Notepad++.

If I give the command in the Execute... dialog

echo %time%

I get

%time%
================ READY ================

and the current time is not being displayed like it would in the cmd prompt.

Does anyone know how to get the time printed?

share|improve this question

1 Answer 1

up vote 2 down vote accepted

Try

cmd /c echo %time%

that should do the trick.

Some background information: echo is a build-in command of the windows command shell cmd, not an executable, so you cannot run it directly by Notepad++. But cmd has a command line option /c where you can pass build-ins as a parameter, to let the command shell execute them for you. The @ sign is only understood within the command shell, too.

share|improve this answer
    
Yes this has worked fine. If I add @echo off I get this error CreateProcess() failed with error code 2: The system cannot find the file specified. –  Nanda Dec 16 '11 at 14:30
    
Marking this as answer as it is working for me. –  Nanda Dec 16 '11 at 14:41
    
@Kishor: see my edit. –  Doc Brown Dec 16 '11 at 15:13
    
I understand now. I tried doing: cmd /c @echo off but it did not work. I will do just fine without it. Thanks –  Nanda Dec 16 '11 at 15:45

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.