• Login
Community
  • Login

Send the file to the server via tftp

Scheduled Pinned Locked Moved Notepad++ & Plugin Development
14 Posts 2 Posters 12.1k Views
Loading More Posts
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • М
    Максим Дунаев
    last edited by Jan 13, 2016, 2:21 AM

    I use NppExec, with following code:

    1. C:\Windows\System32\TFTP.EXE 192.168.1.4 put C:\1\1.txt
    2. tftp.exe 192.168.1.4 put C:\1\1.txt
      all item show error:
      C:\Windows\System32\TFTP.EXE 192.168.1.4 put C:\1\1.txt
      CreateProcess() failed with error code 2:
      Не удается найти указанный файл.
      (Can not find the file specified)

    But next code working
    ping 192.168.1.4

    C 1 Reply Last reply Jan 13, 2016, 2:38 AM Reply Quote 0
    • C
      Claudia Frank @Максим Дунаев
      last edited by Jan 13, 2016, 2:38 AM

      @Максим-Дунаев
      so question would be, does this run if you use a normal cmd?
      Where does tftp.exe come from? Is the order of arguments correct?

      Cheers
      Claudia

      1 Reply Last reply Reply Quote 0
      • М
        Максим Дунаев
        last edited by Jan 13, 2016, 9:25 AM

        When using the Windows console it works fine.
        tftp.exe is a standard Windows tool as well as ftp,ping.

        C 2 Replies Last reply Jan 13, 2016, 1:06 PM Reply Quote 0
        • C
          Claudia Frank @Максим Дунаев
          last edited by Jan 13, 2016, 1:06 PM

          @Максим-Дунаев,

          tftp.exe is a standard Windows tool as well as ftp,ping.

          Yes, I know that MS has one but there are freeware tools also available
          which then differ in how to run the client and which features are available.
          We used to use ms tftp but because of the non existance of -b switch and
          the restriction in file size we changed to another product from cisco.
          You know, that there is normally a fourth parameter called destination,
          which, when skipped, will be assumed as the same as the third parameter, so in your case the remote
          computer needs to understand C:\1\1.txt?

          Cheers
          Claudia

          1 Reply Last reply Reply Quote 0
          • C
            Claudia Frank @Максим Дунаев
            last edited by Claudia Frank Jan 13, 2016, 2:03 PM Jan 13, 2016, 2:02 PM

            @Максим-Дунаев

            just tried it with a local tftp server

            tftp.exe 1.1.1.1 put c:\1\1.txt
            Process started >>>
            transfer successful: 10 bytes in 1 second, 10 bytes/s
            <<< Process finished. (Exit code 0)
            ================ READY ================

            1 Reply Last reply Reply Quote 0
            • М
              Максим Дунаев
              last edited by Jan 14, 2016, 2:47 AM

              Oh sorry in the previous message,i showed not incorrect code.
              This is what happens if perform code in the console NppExec:

              C:\Windows\System32>tftp.exe -i 192.168.1.4 put C:\1\1.txt
              tftp.exe -i 192.168.1.4 put C:\1\1.txt
              “tftp.exe” не является внутренней или внешней
              командой, исполняемой программой или пакетным файлом.
              ( “tftp.exe” not an internal or external command, operable program or batch file.)

              if you specify the full path to tftp.exe it does not change nothing.
              I look through the analyzer (Wireshark) on request packets and see what they are missing.

              C 1 Reply Last reply Jan 14, 2016, 11:10 PM Reply Quote 0
              • C
                Claudia Frank @Максим Дунаев
                last edited by Jan 14, 2016, 11:10 PM

                Hello Максим-Дунаев,

                can you make a screenshot of your NppExec Execute dialog window and upload to e.g. imgur?

                Cheers
                Claudia

                1 Reply Last reply Reply Quote 0
                • М
                  Максим Дунаев
                  last edited by Jan 15, 2016, 3:56 AM

                  http://imgur.com/prsBB2G Execute dialog
                  http://imgur.com/V2XJJBF Used NppExec console

                  1 Reply Last reply Reply Quote 0
                  • C
                    Claudia Frank
                    last edited by Jan 15, 2016, 2:01 PM

                    This is strange, I assume the error is still
                    “tftp.exe” not an internal or external command, operable program or batch file.

                    Can you check which version of tftp.exe you use?
                    Goto C:\windows\System32
                    Right-Click on tftp.exe and press version tab.

                    You are using windows 7 or is it windows server 2008?
                    x86 or x64?

                    Cheers
                    Claudia

                    1 Reply Last reply Reply Quote 0
                    • М
                      Максим Дунаев
                      last edited by Jan 18, 2016, 2:15 AM

                      I use windows 7.
                      http://imgur.com/riV5zp5

                      C 1 Reply Last reply Jan 18, 2016, 1:20 PM Reply Quote 0
                      • C
                        Claudia Frank @Максим Дунаев
                        last edited by Jan 18, 2016, 1:20 PM

                        Hello @Максим-Дунаев,

                        you are right, on windows7 I see the same issue as you. tftp isn’t found. The reason is the file system redirection api
                        introduced in vista. What you can do, to force that system32 directory is used and not being redirected to syswow64,
                        is to use the sysnative alias. So your NppExec command must look like this

                        c:\windows\Sysnative\tftp.exe 192.168.1.4 put C:\1\1.txt
                        

                        I have tested this on my Winows 7 and it works.

                        c:\windows\Sysnative\tftp.exe 192.168.178.26 put C:\1\1.txt
                        Process started >>>
                        Transfer successful: 9 bytes in 1 second(s), 9 bytes/s
                        <<< Process finished. (Exit code 0)
                        ================ READY ================
                        

                        Cheers
                        Claudia

                        1 Reply Last reply Reply Quote 0
                        • М
                          Максим Дунаев
                          last edited by Jan 19, 2016, 2:17 AM

                          Great, thank you for your help.

                          1 Reply Last reply Reply Quote 0
                          12 out of 14
                          • First post
                            12/14
                            Last post
                          The Community of users of the Notepad++ text editor.
                          Powered by NodeBB | Contributors