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.
  • 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
                    • T trønderen

                      charlieg wrote:

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

                      Usually, when people make statements along these lines, I reply: Why the elephant do you select a 40+ year old command interpreter language? Why haven't you switched to Powershell many years ago? The typical answer is, like: Huh?? Powershell? I never cared to look at it, and I am certainly not going to waste my time on it! Why hasn't Windows switched to something like bash? I'll tell you why: Because Windows users simply refuse to learn anything new. They will not realize that with bash, they could write really advanced scripts, but they are simply ignorant and lazy. Me: Yeah, I guess you are right. Linux guys are far more willing to learn of alternatives to their favorite tools. Just look at yourself, how eager your are to learn the advanced command processor that is native to Windows! The other guy: Go *** yourself! You are exactly the way Windows guys are. You go ahead first, and learn bash, then you can start patronizing. Me: I have been using bash for about twenty-five years. The other guy: So why do you tell me not to use it? Me: Maybe you are better off getting a bash interpreter for Windows...

                      P Offline
                      P Offline
                      Peter Adam
                      wrote on last edited by
                      #31

                      bash is just as awful write-only thing as the cmd processor's language. Which parentheses today, and how much of them? Just look at any java starter sh file how much pain is to figure out where java is installed. Debugger support is also outstanding.

                      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

                        M Offline
                        M Offline
                        MKJCP
                        wrote on last edited by
                        #32

                        It appears it was Tim Paterson and he's not dead yet https://www.youtube.com/watch?v=uBxMPqxJGqI. So, you'll have to wait. My company has been using some .bat files for certain things and they still work decades later, never needing an update or change.

                        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.

                          H Offline
                          H Offline
                          Hooga Booga
                          wrote on last edited by
                          #33

                          "The reports of my death have been greatly exaggerated."

                          Outside of a dog, a book is a man's best friend; inside of a dog, it's too dark to read. -- Groucho Marx

                          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
                            davecasdf
                            wrote on last edited by
                            #34

                            I found that the two big problems with .bat files ( actually the command interpreter ) _wasn't_ it's weakness, but that the bright eyes at Microsoft: 1, typically didn't have commands return anything ( the stupid elephanting "void main(void)" mentality before that plague started ), and 2. edlin can't do search and replace when script driven. ( As I remember, it can't do _anything_ useful without using the "F" keys. ) ( I had a Regulus box years back, it built the apropos database ( overnight ) by reading the man directory and chaining shell scripts, I think the only thing it did other than build scripts with ed that dos couldn't by itself was use "roll" to pick successive keywords)

                            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

                              K Offline
                              K Offline
                              Kyle Brown
                              wrote on last edited by
                              #35

                              Just to clarify the point, modern windows OSs don't run MS-DOS. Early versions of windows and the 9x line ran on top of MS-DOS so launching a command prompt would actually just expose the MS-DOS command interrupter running underneath windows. The Windows NT line, which XP, Vista, 7, 8 and 10 are a part of, was developed separately from MS-DOS and doesn't contain the MS-DOS command interrupter. Instead it has a program called cmd.exe which supports a similar set of commands but is very much distinct from MS-DOS. So Windows bat/cmd files still exist and are used but they aren't MS-DOS bat files.

                              T 1 Reply Last reply
                              0
                              • K Kyle Brown

                                Just to clarify the point, modern windows OSs don't run MS-DOS. Early versions of windows and the 9x line ran on top of MS-DOS so launching a command prompt would actually just expose the MS-DOS command interrupter running underneath windows. The Windows NT line, which XP, Vista, 7, 8 and 10 are a part of, was developed separately from MS-DOS and doesn't contain the MS-DOS command interrupter. Instead it has a program called cmd.exe which supports a similar set of commands but is very much distinct from MS-DOS. So Windows bat/cmd files still exist and are used but they aren't MS-DOS bat files.

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

                                Kyle Brown wrote:

                                So Windows bat/cmd files still exist and are used but they aren't MS-DOS bat files.

                                Obviously, they are still .bat files, though! Like a C++ or C# file: It is still a set of instructions to be interpreted by some compiler and runtime system. Even if one environment retires, the semantics of the instructions remain for interpretation in some other environment. You could easily write a .bat file interpreter for a linux environment, like you can write interpreters for bash or sh scripts in a Windows environment. The underlaying OS and runtime for the interpreter is not essential. (Except, of course, if the interpreter insists on a non-conforming interpretation of the actual environment. Such as insisting on environment symbols being case sensitive, when the environment defines them as not case sensitive. But this is a question of the interpreter honoring conventions of its environment, not of the execution platform of the interpreter.)

                                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

                                  M Offline
                                  M Offline
                                  MSBassSinger
                                  wrote on last edited by
                                  #37

                                  As for me, if the task is too complicated for a simple BAT file, I write it in C#. For me (not speaking for anyone else), I have not found a good use for me to use PowerShell, and I have avoided the UNIX-like OSs (like Linux) as much as possible since the early 90s.

                                  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

                                    M Offline
                                    M Offline
                                    MadGerbil
                                    wrote on last edited by
                                    #38

                                    What we need is a library built upon a framework with designers, design patterns, logging, a UI and SASS implementation so that a few lines of code can be turned into the nightmare that is modern web development.

                                    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

                                      M Offline
                                      M Offline
                                      Member 10642872
                                      wrote on last edited by
                                      #39

                                      Charlie: I see I am falling into the next thread (Sure sign I should retire -- I know what a Wang and an AS/400 are). Batch files predate MS-DOS. They were how things were done on RT-11 and RSX-11 on PDP-11 computers. Many of the C and Unix and early PC operating system guys all started on PDP-11s (circa 1975) when they were in school. So the guy you are looking for probably is very long dead and buried near Boston. I suppose it is interesting that it is still possible to write really horrible batch files to run in a command window. Just recently did an update on a set of TeraTerm command files. Interesting, but not something I would do by choice! The guy who *really* deserves our hatred is the guy who created all the macros for MASM and early versions of Microsoft C. If you ever had a bug caused by one of those, you could spend a career just trying to unroll all of the macros :-) :-(

                                      C 1 Reply Last reply
                                      0
                                      • Greg UtasG Greg Utas

                                        See the "Rant" button toward the right, just above where you type in your post's subject? :laugh:

                                        Robust Services Core | Software Techniques for Lemmings | Articles
                                        The fox knows many things, but the hedgehog knows one big thing.

                                        C Offline
                                        C Offline
                                        charlieg
                                        wrote on last edited by
                                        #40

                                        blush, I do now :)

                                        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

                                        1 Reply Last reply
                                        0
                                        • T trønderen

                                          charlieg wrote:

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

                                          Usually, when people make statements along these lines, I reply: Why the elephant do you select a 40+ year old command interpreter language? Why haven't you switched to Powershell many years ago? The typical answer is, like: Huh?? Powershell? I never cared to look at it, and I am certainly not going to waste my time on it! Why hasn't Windows switched to something like bash? I'll tell you why: Because Windows users simply refuse to learn anything new. They will not realize that with bash, they could write really advanced scripts, but they are simply ignorant and lazy. Me: Yeah, I guess you are right. Linux guys are far more willing to learn of alternatives to their favorite tools. Just look at yourself, how eager your are to learn the advanced command processor that is native to Windows! The other guy: Go *** yourself! You are exactly the way Windows guys are. You go ahead first, and learn bash, then you can start patronizing. Me: I have been using bash for about twenty-five years. The other guy: So why do you tell me not to use it? Me: Maybe you are better off getting a bash interpreter for Windows...

                                          C Offline
                                          C Offline
                                          charlieg
                                          wrote on last edited by
                                          #41

                                          Powershell imho is bat files on steroids. I've looked at it, and well X|

                                          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

                                          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