Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. The Lounge
  3. MS-DOS bat files must die...

MS-DOS bat files must die...

Scheduled Pinned Locked Moved The Lounge
help
44 Posts 32 Posters 0 Views 1 Watching
  • 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.
  • C charlieg

    I have no idea who came up with this crap, but I will piss on his/her grave. Off to a real scripting language...

    Charlie Gilley <italic>Stuck in a dysfunctional matrix from which I must escape... "Where liberty dwells, there is my country." B. Franklin, 1783 “They who can give up essential liberty to obtain a little temporary safety deserve neither liberty nor safety.” BF, 1759

    OriginalGriffO Offline
    OriginalGriffO Offline
    OriginalGriff
    wrote on last edited by
    #11

    You have to remember that .BAT files were invented in the days of floppy disks and command lines, when you didn't want to create a C program that included a 50K library file in order to sort a directory listing by modification date then print it to the display in pages; and another to do it in reverse size order; and another of only show the "ACC*.CSV" files the same way, and ... That they still work at all, and are of any use - and they are, occasionally I'm sure even if I personally haven't used one in decades - is a testament to just how well they were designed in the first place! The world has moved on, is all - so we expect more power, more flexibility, better structure.

    "I have no idea what I did, but I'm taking full credit for it." - ThisOldTony "Common sense is so rare these days, it should be classified as a super power" - Random T-shirt AntiTwitter: @DalekDave is now a follower!

    "I have no idea what I did, but I'm taking full credit for it." - ThisOldTony
    "Common sense is so rare these days, it should be classified as a super power" - Random T-shirt

    pkfoxP C 2 Replies Last reply
    0
    • C Cp Coder

      Quote:

      Batch files have been dead since Windows 95

      Noooooo! I still use them every day! With Windows 10!

      Get me coffee and no one gets hurt!

      R Offline
      R Offline
      RickZeeland
      wrote on last edited by
      #12

      I still make heavy use of DOS batch files on our Windows builder that runs the latest version of TeamCity. Always refused to make use of extra tools such as NANT, but I have to admit that although you can accomplish a lot with batch files, readability is not a strong point of DOS batch files. :-\

      1 Reply Last reply
      0
      • C charlieg

        I have no idea who came up with this crap, but I will piss on his/her grave. Off to a real scripting language...

        Charlie Gilley <italic>Stuck in a dysfunctional matrix from which I must escape... "Where liberty dwells, there is my country." B. Franklin, 1783 “They who can give up essential liberty to obtain a little temporary safety deserve neither liberty nor safety.” BF, 1759

        D Offline
        D Offline
        den2k88
        wrote on last edited by
        #13

        BAT for scripting? Bleargh. BAT for quick automation? Gold.

        GCS d--(d+) s-/++ a C++++ U+++ P- L+@ E-- W++ N+ o+ K- w+++ O? M-- V? PS+ PE- Y+ PGP t+ 5? X R+++ tv-- b+(+++) DI+++ D++ G e++ h--- r+++ y+++*      Weapons extension: ma- k++ F+2 X

        J 1 Reply Last reply
        0
        • C charlieg

          I have no idea who came up with this crap, but I will piss on his/her grave. Off to a real scripting language...

          Charlie Gilley <italic>Stuck in a dysfunctional matrix from which I must escape... "Where liberty dwells, there is my country." B. Franklin, 1783 “They who can give up essential liberty to obtain a little temporary safety deserve neither liberty nor safety.” BF, 1759

          L Offline
          L Offline
          Lost User
          wrote on last edited by
          #14

          I still use them, they are just so easy to work with compared to the "wonderful" Powershell.

          pkfoxP G 2 Replies Last reply
          0
          • D den2k88

            BAT for scripting? Bleargh. BAT for quick automation? Gold.

            GCS d--(d+) s-/++ a C++++ U+++ P- L+@ E-- W++ N+ o+ K- w+++ O? M-- V? PS+ PE- Y+ PGP t+ 5? X R+++ tv-- b+(+++) DI+++ D++ G e++ h--- r+++ y+++*      Weapons extension: ma- k++ F+2 X

            J Offline
            J Offline
            Jorgen Andersson
            wrote on last edited by
            #15

            I'm curious to hear the difference in their definitions. :)

            Wrong is evil and must be defeated. - Jeff Ello

            D 1 Reply Last reply
            0
            • OriginalGriffO OriginalGriff

              You have to remember that .BAT files were invented in the days of floppy disks and command lines, when you didn't want to create a C program that included a 50K library file in order to sort a directory listing by modification date then print it to the display in pages; and another to do it in reverse size order; and another of only show the "ACC*.CSV" files the same way, and ... That they still work at all, and are of any use - and they are, occasionally I'm sure even if I personally haven't used one in decades - is a testament to just how well they were designed in the first place! The world has moved on, is all - so we expect more power, more flexibility, better structure.

              "I have no idea what I did, but I'm taking full credit for it." - ThisOldTony "Common sense is so rare these days, it should be classified as a super power" - Random T-shirt AntiTwitter: @DalekDave is now a follower!

              pkfoxP Offline
              pkfoxP Offline
              pkfox
              wrote on last edited by
              #16

              Because I spend a lot of time using Linux I have a few .bat files on my Windows boxes that mirror my Linux common and aliased commands. I would love Windows to support aliases.

              "I didn't mention the bats - he'd see them soon enough" - Hunter S Thompson - RIP

              A T 2 Replies Last reply
              0
              • L Lost User

                I still use them, they are just so easy to work with compared to the "wonderful" Powershell.

                pkfoxP Offline
                pkfoxP Offline
                pkfox
                wrote on last edited by
                #17

                And me - if you're going to use the advanced PS stuff you might as well write a proper compiled program

                "I didn't mention the bats - he'd see them soon enough" - Hunter S Thompson - RIP

                L 1 Reply Last reply
                0
                • pkfoxP pkfox

                  And me - if you're going to use the advanced PS stuff you might as well write a proper compiled program

                  "I didn't mention the bats - he'd see them soon enough" - Hunter S Thompson - RIP

                  L Offline
                  L Offline
                  Lost User
                  wrote on last edited by
                  #18

                  I have actually found a few occasions when a Powershell script of three or four lines did what in C would have needed at least 30 to 50 lines. The main problem I have with Powershell is learning it properly.

                  1 Reply Last reply
                  0
                  • C charlieg

                    I have no idea who came up with this crap, but I will piss on his/her grave. Off to a real scripting language...

                    Charlie Gilley <italic>Stuck in a dysfunctional matrix from which I must escape... "Where liberty dwells, there is my country." B. Franklin, 1783 “They who can give up essential liberty to obtain a little temporary safety deserve neither liberty nor safety.” BF, 1759

                    R Offline
                    R Offline
                    Rage
                    wrote on last edited by
                    #19

                    How should I compile without batch files ? :laugh: I like them. Back in the years, I even made quite powerful things with batches ( against all best practices of coding, of course. Batch is organized chaos).

                    Do not escape reality : improve reality !

                    1 Reply Last reply
                    0
                    • J Jorgen Andersson

                      I'm curious to hear the difference in their definitions. :)

                      Wrong is evil and must be defeated. - Jeff Ello

                      D Offline
                      D Offline
                      den2k88
                      wrote on last edited by
                      #20

                      Scripting is programming the shell, with complex logic (i.e. conditions, loops, etc). Quick automation to me means executing a simple sequence of commands with their parameters, with only a very small amount of logic (i.e. setting relative paths, file names and in some cases checking some return value). It's a quick macro, a shortcut to avoid typing dozens of characters.

                      GCS d--(d+) s-/++ a C++++ U+++ P- L+@ E-- W++ N+ o+ K- w+++ O? M-- V? PS+ PE- Y+ PGP t+ 5? X R+++ tv-- b+(+++) DI+++ D++ G e++ h--- r+++ y+++*      Weapons extension: ma- k++ F+2 X

                      J 1 Reply Last reply
                      0
                      • D den2k88

                        Scripting is programming the shell, with complex logic (i.e. conditions, loops, etc). Quick automation to me means executing a simple sequence of commands with their parameters, with only a very small amount of logic (i.e. setting relative paths, file names and in some cases checking some return value). It's a quick macro, a shortcut to avoid typing dozens of characters.

                        GCS d--(d+) s-/++ a C++++ U+++ P- L+@ E-- W++ N+ o+ K- w+++ O? M-- V? PS+ PE- Y+ PGP t+ 5? X R+++ tv-- b+(+++) DI+++ D++ G e++ h--- r+++ y+++*      Weapons extension: ma- k++ F+2 X

                        J Offline
                        J Offline
                        Jorgen Andersson
                        wrote on last edited by
                        #21

                        It's odd how definitions tend to change with time. When I studied automation many many years ago, scripting was one of the tools available to achieve the task... today it seems to be a cron job.

                        Wrong is evil and must be defeated. - Jeff Ello

                        1 Reply Last reply
                        0
                        • O obermd

                          DOS Batch files have been dead since Windows 95. They were replace by Windows .cmd files, which actually are rather powerful for someone who knows how to use the various commands and their switches.

                          N Offline
                          N Offline
                          Nelek
                          wrote on last edited by
                          #22

                          obermd wrote:

                          Batch files have been dead since Windows 95.

                          :omg: :omg: :omg: :wtf: :wtf: :wtf: Really? I guess 70% of the world just didn't get that memo.

                          M.D.V. ;) If something has a solution... Why do we have to worry about?. If it has no solution... For what reason do we have to worry about? Help me to understand what I'm saying, and I'll explain it better to you Rating helpful answers is nice, but saying thanks can be even nicer.

                          1 Reply Last reply
                          0
                          • L Lost User

                            I still use them, they are just so easy to work with compared to the "wonderful" Powershell.

                            G Offline
                            G Offline
                            GenJerDan
                            wrote on last edited by
                            #23

                            And then you run into things like PowerShell is disabled because users can't be trusted not to destroy the systems with it. :laugh:

                            We won't sit down. We won't shut up. We won't go quietly away. YouTube, and My Mu[sic], Films and Windows Programs, etc. and FB

                            C 1 Reply Last reply
                            0
                            • C charlieg

                              I have no idea who came up with this crap, but I will piss on his/her grave. Off to a real scripting language...

                              Charlie Gilley <italic>Stuck in a dysfunctional matrix from which I must escape... "Where liberty dwells, there is my country." B. Franklin, 1783 “They who can give up essential liberty to obtain a little temporary safety deserve neither liberty nor safety.” BF, 1759

                              F Offline
                              F Offline
                              Forogar
                              wrote on last edited by
                              #24

                              Batch files rule!! I still depend upon them and have done for well over 30 years. How many other technologies "just work" for over three decades?

                              - I would love to change the world, but they won’t give me the source code.

                              1 Reply Last reply
                              0
                              • C Cp Coder

                                Quote:

                                Batch files have been dead since Windows 95

                                Noooooo! I still use them every day! With Windows 10!

                                Get me coffee and no one gets hurt!

                                O Offline
                                O Offline
                                obermd
                                wrote on last edited by
                                #25

                                The .bat extension is handled by the same command line processor as the .cmd extension. Both extensions work except in machine startup scripts where you have to use .cmd.

                                1 Reply Last reply
                                0
                                • C charlieg

                                  I have no idea who came up with this crap, but I will piss on his/her grave. Off to a real scripting language...

                                  Charlie Gilley <italic>Stuck in a dysfunctional matrix from which I must escape... "Where liberty dwells, there is my country." B. Franklin, 1783 “They who can give up essential liberty to obtain a little temporary safety deserve neither liberty nor safety.” BF, 1759

                                  R Offline
                                  R Offline
                                  rnbergren
                                  wrote on last edited by
                                  #26

                                  I love the answers to this. For everything someone hates (except maybe linq) there are at least a person or 15 that loves it. I personally use BAT files all the time. Like someone said. Perfect for automation of something simple, IE copy file1 to file location2 at this time everyday. I also use Powershell a ton. It works it is difficult to learn and get accustomed to. But it is powerful. When in Linux I use your good old shell scripts. Those are awesome. But I am stuck with bat and winders powershell at work. Also, love that comment about powershell security for some people to keep them from shooting themselves in the foot. HAHAHAHA

                                  To err is human to really elephant it up you need a computer

                                  1 Reply Last reply
                                  0
                                  • pkfoxP pkfox

                                    Because I spend a lot of time using Linux I have a few .bat files on my Windows boxes that mirror my Linux common and aliased commands. I would love Windows to support aliases.

                                    "I didn't mention the bats - he'd see them soon enough" - Hunter S Thompson - RIP

                                    A Offline
                                    A Offline
                                    ACRowland
                                    wrote on last edited by
                                    #27

                                    I tried to install 4DOS on my Win10 box the other week so I could use aliases. Should I just die in shame?

                                    M 1 Reply Last reply
                                    0
                                    • C charlieg

                                      I have no idea who came up with this crap, but I will piss on his/her grave. Off to a real scripting language...

                                      Charlie Gilley <italic>Stuck in a dysfunctional matrix from which I must escape... "Where liberty dwells, there is my country." B. Franklin, 1783 “They who can give up essential liberty to obtain a little temporary safety deserve neither liberty nor safety.” BF, 1759

                                      S Offline
                                      S Offline
                                      sum none
                                      wrote on last edited by
                                      #28

                                      Bat/cmd files are and always will be the easiest way to automate the command line. Many times, it's even easier to use a bat file in task scheduler than it is to try and get the commands working with task scheduler, especially if there are multiple commands or maybe other considerations. The right tool for the job, as always. As far as in depth scripting, everyone knows the best tool is vbscript. :cool: When that fails, bust out the Visual Studio...or sometimes powershell once in a blue moon.

                                      1 Reply Last reply
                                      0
                                      • pkfoxP pkfox

                                        Because I spend a lot of time using Linux I have a few .bat files on my Windows boxes that mirror my Linux common and aliased commands. I would love Windows to support aliases.

                                        "I didn't mention the bats - he'd see them soon enough" - Hunter S Thompson - RIP

                                        T Offline
                                        T Offline
                                        trønderen
                                        wrote on last edited by
                                        #29

                                        doskey /?

                                        1 Reply Last reply
                                        0
                                        • A ACRowland

                                          I tried to install 4DOS on my Win10 box the other week so I could use aliases. Should I just die in shame?

                                          M Offline
                                          M Offline
                                          Member 14136011
                                          wrote on last edited by
                                          #30

                                          Ah yes! 4DOS. That brings me back a way.

                                          1 Reply Last reply
                                          0
                                          Reply
                                          • Reply as topic
                                          Log in to reply
                                          • Oldest to Newest
                                          • Newest to Oldest
                                          • Most Votes


                                          • Login

                                          • Don't have an account? Register

                                          • Login or register to search.
                                          • First post
                                            Last post
                                          0
                                          • Categories
                                          • Recent
                                          • Tags
                                          • Popular
                                          • World
                                          • Users
                                          • Groups