Welcome guest. Before posting on our computer help forum, you must register. Click here it's easy and free.

Author Topic: Can u Convert a COM File back into a Batch File?  (Read 6359 times)

0 Members and 2 Guests are viewing this topic.

macdad-

    Topic Starter


    Expert

    Thanked: 40
    Can u Convert a COM File back into a Batch File?
    « on: February 14, 2008, 02:46:33 PM »
    i have found that you can convert your batch programs into com files but can you convert a com file back into a batch file?
    If you dont know DOS, you dont know Windows...

    Thats why Bill Gates created the Windows NT Family.

    SOAP



      Beginner

      YES!
      « Reply #1 on: February 14, 2008, 04:29:33 PM »
      Ya, just rename it from .bat to .com, and if that doesn't work it means that your settings are set where it doesn't show the extensions.

      patio

      • Moderator


      • Genius
      • Maud' Dib
      • Thanked: 1769
        • Yes
      • Experience: Beginner
      • OS: Windows 7
      Re: Can u Convert a COM File back into a Batch File?
      « Reply #2 on: February 14, 2008, 05:08:56 PM »
      Somehow i don't think this experiment will work...
      " Anyone who goes to a psychiatrist should have his head examined. "

      SOAP



        Beginner

        Re: Can u Convert a COM File back into a Batch File?
        « Reply #3 on: February 14, 2008, 08:08:17 PM »
        It works for me. If you just make a .bat file and change it to a .com you can change it back. Try it if you got time.

        llmeyer1000



          Intermediate

          Thanked: 1
          Re: Can u Convert a COM File back into a Batch File?
          « Reply #4 on: February 15, 2008, 12:50:20 AM »
          Patio was way too nice.

          Why don't you try your wee little experiment on a real .com file instead of a batch file that  you simply renamed incorrectly. Then open your new "batch" file and see if you can edit it.


          Sidewinder



            Guru

            Thanked: 139
          • Experience: Familiar
          • OS: Windows 10
          Re: Can u Convert a COM File back into a Batch File?
          « Reply #5 on: February 15, 2008, 05:21:51 AM »
          Quote
          i have found that you can convert your batch programs into com files but can you convert a com file back into a batch file?

          Doubtful. You might find a disassembler that would make it somewhat readable, but don't count on any program turning it back into the original text file.

          Quote
          It works for me. If you just make a .bat file and change it to a .com you can change it back. Try it if you got time.

          Quote
          Ya, just rename it from .bat to .com, and if that doesn't work it means that your settings are set where it doesn't show the extensions.

          This would be interesting if it were true. COM files are executables that generally run inside the shell program. BAT files are text files that need an interpreter to run in the shell program. They are not interchangeable and it's unlikely the operating system would mistake one for the other.

           8)
          The true sign of intelligence is not knowledge but imagination.

          -- Albert Einstein

          Dias de verano

          • Guest
          Re: Can u Convert a COM File back into a Batch File?
          « Reply #6 on: February 15, 2008, 06:16:17 AM »
          The way many of these these batch-to-com and batch-to-exe "compilers" work is by attaching an executable  header to the submitted batch file. The header contains an interpreter rather like cmd.exe or command.com, but often it will only handle a subset of the full range of commands. When the executable file is run, the interpreter gets to work on the attached embedded batch script  I guess one could examine such a "compiled" com file in a hex editor and view the original batch file therefore, and also determine where to cut in order to retrieve it.

          Of course it a true compiler was used, and machine code produced, a disassembler would need to be used, but it wuld be unlikely to produce anything very comprehensible.

          RCSINJ

          • Guest
          Re: Can u Convert a COM File back into a Batch File?
          « Reply #7 on: February 15, 2008, 09:24:18 AM »
          Changing the name of the extension from bat to com or anything else doesn't change the file or how it runs. " A rose by any other name would still be a rose" whether it smells as sweet or not

          Dias de verano

          • Guest
          Re: Can u Convert a COM File back into a Batch File?
          « Reply #8 on: February 15, 2008, 09:43:41 AM »
            Changing the name of the extension from bat to com [...] doesn't change [...] how it runs.

            That is not true. The OS will try to execute a batch one way, and a .com another way. Changing the extension either way will make the file impossible to execute.

            Quote

            C:\>type tryme.bat
            @echo off
            echo %date% %time% Hello World
            echo.

            C:\>tryme.bat
            15/02/2008 16:30:10.29 Hello World

            C:\>ren tryme.bat tryme.com

            C:\>tryme.com
            Cannot execute C:\TRYME.COM


            [/list]

            macdad-

              Topic Starter


              Expert

              Thanked: 40
              Re: Can u Convert a COM File back into a Batch File?
              « Reply #9 on: February 15, 2008, 01:56:02 PM »
              ok i guess i didnt make it fully clear. i want to convert com files back into batch files. all the graphics the com files have made me curious and i wondered how can i make these graphics (boxes, borders, and backgrounds)
              If you dont know DOS, you dont know Windows...

              Thats why Bill Gates created the Windows NT Family.

              Dias de verano

              • Guest
              Re: Can u Convert a COM File back into a Batch File?
              « Reply #10 on: February 15, 2008, 01:59:16 PM »
              ok i guess i didnt make it fully clear. i want to convert com files back into batch files.

              I guess we didn't make it fully clear either. You can't.

              macdad-

                Topic Starter


                Expert

                Thanked: 40
                Re: Can u Convert a COM File back into a Batch File?
                « Reply #11 on: February 15, 2008, 03:11:08 PM »
                oh then how do can u make the boxes backgrounds and all the special graphics in com files?
                If you dont know DOS, you dont know Windows...

                Thats why Bill Gates created the Windows NT Family.

                Dusty



                  Egghead

                • I could if she would, but she won't so I don't.
                • Thanked: 75
                • Experience: Beginner
                • OS: Windows XP
                Re: Can u Convert a COM File back into a Batch File?
                « Reply #12 on: February 15, 2008, 05:14:43 PM »
                Echo the special characters (Alt+keypad number) for what you want.

                One good deed is worth more than a year of good intentions.

                macdad-

                  Topic Starter


                  Expert

                  Thanked: 40
                  Re: Can u Convert a COM File back into a Batch File?
                  « Reply #13 on: February 15, 2008, 05:30:23 PM »
                  are the keypad #'s the ASCII # for the characters?
                  If you dont know DOS, you dont know Windows...

                  Thats why Bill Gates created the Windows NT Family.

                  Dusty



                    Egghead

                  • I could if she would, but she won't so I don't.
                  • Thanked: 75
                  • Experience: Beginner
                  • OS: Windows XP
                  Re: Can u Convert a COM File back into a Batch File?
                  « Reply #14 on: February 16, 2008, 01:47:36 AM »
                  Yes, the ASCII codes are shown >>here<<.

                  One good deed is worth more than a year of good intentions.