Can not create new file from command line

2005-09-15
2012-11-13
  • Nobody/Anonymous

    First of all: I love notepad++. THANK YOU donho!!!

    OK then: From command line I try to open notepad++ and at the same time create a new file:
    c:\>notepad++ newfile.txt
    This gives me an error saying: Can not open file "". If I do it against an existing file, it obviously works fine.

    Is thie feature not implemented or am I doing something wrong?

    Niels

     
    • Nobody/Anonymous

      Thanks for the suggestion - will do!!

      Niels

       
    • Paulius

      Paulius - 2005-09-16

      i think it isn't implemented.
      however, you can always use batch files for that!
      echo. >newfile.txt && start notepad++ newfile.txt

      here, if you hava touch.exe (from gnuwin32.sf.net) in your path then you can put these 5 lines into file npp.cmd:
      @echo off
      if $%1$ == $$ goto @skip
      if not exist %1 touch %1
      :@skip
      notepad++ %1

      then, you should put this npp.cmd file somewhere in your path. after that - you can run notepad++ anytime you want using command "npp <filename>" and if the file will not be there - it will be created.

      PS: if you don't have touch.exe, and you don't want to download it, then you can replace "touch" with "echo.>%1" in the code above - it's almost the same thing.

      Good Luck!

       

Get latest updates about Open Source Projects, Conferences and News.

Sign up for the SourceForge newsletter:





No, thanks