• @ShortFuse@lemmy.world
      link
      fedilink
      1
      edit-2
      2 years ago

      Yes in Windows Server since, IIRC, 2012". No in Windows client versions.

      I’m so used to Server commands I sometimes am surprised when commands like logoff don’t work.

    • @captsneeze@lemmy.one
      link
      fedilink
      652 years ago

      As of Aug 26, 2023, Windows command prompt absolutely does not recognize “ls” as a command.

      Powershell is a different story.

      Source: I type “ls” 40 times a day into a command prompt on my up-to-date win10 PC at work.

      • @icesentry@lemmy.ca
        link
        fedilink
        22 years ago

        Out of curiosity what do you do to frequently end up with cmd? I don’t think I’ve touched it in many years at this point.

        • @captsneeze@lemmy.one
          link
          fedilink
          12 years ago

          It’s my own fault, and the result of 30+ years of muscle memory building up. Plus, while I agree cmd isn’t nearly as powerful as powershell or wsl can be, when I’m in Windows it’s still the fastest way for me to do 90% of the simple things I need to do. I have a long history with it, and a thorough understanding of it, so I don’t really need to think for most of the things I’m doing there.

          If I need to script something, or do anything that seems like it would be annoying to do in CMD, I hop into WSL pretty quickly and get to work with bash or python. The problem I have now is that I’ve developed a little muscle memory there as well… hence my issue with entering ‘ls’ everywhere.

        • @mateomaui@reddthat.com
          link
          fedilink
          English
          12 years ago

          Lately I’ve been using it as a simple way to drag and drop a source .tar.xz archive on a .bat file so it can be twice extracted, moved, renamed, have dependencies downloaded by git, run a cmake process, do a visual studio compile, then move the result release directory back to where the .bat file is while removing unneeded files and adding new ones.

          cmd and batch still has its uses.

        • @captsneeze@lemmy.one
          link
          fedilink
          1
          edit-2
          2 years ago

          That is interesting. I just remoted into 5 different machines at the office and none of them worked with ‘ls’. If you enter ‘ls /?’, does it give you a synopsis and argument list?

          • @mateomaui@reddthat.com
            link
            fedilink
            English
            12 years ago

            If I do “ls /?” it returns no such file or directory, but just “ls” performs exactly as you’d expect. I haven’t installed anything to provide that function that I know of. It never occurred to me that I would have to because as far as I know it’s always worked. Until today I just assumed it had become a standard command and never investigated. Was just happy I could use the same command in cmd and on my Pi box.

      • @CaptPretentious@lemmy.world
        link
        fedilink
        -52 years ago

        The year is 2023, if you’re still using CMD or batch files still that’s on you. It’s like riding a horse down a freeway and yelling at cars.

  • voxel
    link
    fedilink
    36
    edit-2
    2 years ago

    use powershell (specifically the core version!!!), or even better something like Nu shell

        • Square Singer
          link
          fedilink
          22 years ago

          Because Wine makes it possible ;)

          Nah, mine was a joke on how Microsoft published Powershell on Linux and somehow thought that anyone was gonna use it.

          • Gadg8eer
            link
            fedilink
            English
            12 years ago

            The OpenTTD community does sometimes. Not that it matters much.

  • 𝕸𝖔𝖘𝖘
    link
    fedilink
    English
    322 years ago

    Add ls.bat in your windows directory with dir as the source. It basically acts as an alias.

    • @jasondj@ttrpg.network
      link
      fedilink
      222 years ago

      Still won’t help me when I type ifconfig or dig, though.

      Also I’ve noticed there is also a curl in Windows CLI that I believe is based on libcurl, but when called from powershell is an alias for (iirc) Invoke-WebRequest.

      • @jvisick@programming.dev
        link
        fedilink
        English
        42 years ago

        I came across this one just yesterday and while it was convenient at first, I immediately got frustrated when I went to add some parameters and discovered it wasn’t actually curl

        • @JustBrian7872@feddit.de
          link
          fedilink
          42 years ago

          Classic PoweShell experience. Try rm -rf - I wonder why they added the aliases in the first place. Only frustrating to type different arguments which are also more verbose. Tastes like the good ol’ embrace-extend-extinguish.

          • Carlos Solís
            link
            fedilink
            72 years ago

            You can still use winget by itself from the command line! The UI is just there for convenience and automation

            • @Kangie@lemmy.srcfiles.zip
              link
              fedilink
              72 years ago

              The UI is just there for … automation

              Wut?

              I’ve never gone to a UI when I want to automate something, a sane CLI is much more predictable and consistent.

              • Carlos Solís
                link
                fedilink
                42 years ago

                Winget-UI specifically can run the upgrade tool automatically for you, that’s what I meant for “automation”. You could also add a scheduler to run Winget by itself every day if you need to.

        • @bob_wiley@lemmy.world
          link
          fedilink
          English
          52 years ago

          It annoys me to no end that winget is a consumer only thing and not for the enterprise. It would be so useful in the enterprise….

      • @Zeth0s@lemmy.world
        link
        fedilink
        412 years ago

        “Usable” is a strong statement… It went from a “misery inducing insufferable machine” to a “extremely big annoyance”. I do concede it is anyway a progress

      • I really want to love the “everything is an object” of power shell but I just have zero uses for using a shell on windows. Granted, my windows usage is like 15 minutes a week most of the time, but still. I also can’t be bothered to use it for work because it’s exclusively Linux/linux-ish over there so it’s not worth bothering.

        Either way, I like the idea, can’t really justify figuring out the details.

        • @DV8@lemmy.world
          link
          fedilink
          42 years ago

          If you only have to use it 15 minutes every week it’s probably not worth getting to know.

          I work in a Windows shop, so I love everything being an object, most of the time. At least for the things that are worked out completely.

          It’s great for things you need to iterate or just for figuring out what you can do by piping a result to get-member. If you are interested in getting better at powershell at some point, I highly recommend Powershell in a month of lunches. (Also because I like Manning’s model where they automatically offer the digital versions of books they sell, and also offering free previews of the entire book, given enough time)

        • @______@lemm.ee
          link
          fedilink
          22 years ago

          “But PS is open source ! Don’t you want to use it in Linux and MacOS?” - Microsoft probably

          • @wizardbeard@lemmy.dbzer0.com
            link
            fedilink
            English
            12 years ago

            It’s a wonderful tool for me in a Windows environment/shop, especially with how it works well with all the Windows and Microsoft administration systems/tools we use.

            Personally, I’m less interested in any language’s hypothetical merits than how it fits as a tool for what I need to accomplish and ease of future maintenance when the script/program/automation inevitably needs to be adjusted.

            All that said, I can’t think of a legitimate reason to use PSCore on non-Windows hardware unless you’re just really familiar with PS and literally nothing else. Even then you’re better off taking time learning a better tool for that environment.

            • @______@lemm.ee
              link
              fedilink
              12 years ago

              That’s a very good point. My angle is as a dev and not as IT or sys admin. Power shell is probably far more powerful in those circles.

    • Halafax
      link
      fedilink
      102 years ago

      If you can suppress 30 years of " -al" from following his buddy.

    • @ox0r@jlai.lu
      link
      fedilink
      English
      212 years ago

      Yeah but tbh i really despise powershells syntax. But i’m happy it is pretty powerful.

        • Butt Pirate
          link
          fedilink
          102 years ago

          Bash came out decades ago and powershell is brand new. It doesn’t really have an excuse to suck.

          • @______@lemm.ee
            link
            fedilink
            52 years ago

            I hope I didn’t come across as defending ps. PS sucks and whoever decided to have functions use capital case with dashes in between needs to have their brain scanned

            • @wizardbeard@lemmy.dbzer0.com
              link
              fedilink
              English
              1
              edit-2
              2 years ago

              I do a lot of work in PS and I don’t find it that bad. But you forgot what’s even dumber about their function naming conventions.

              Function names are supposed to be a single word verb, then the dash, then the rest. But not any verb, you’re supposed to use one from PS’s list of acceptable ones which has some really weird omissions. And they break their own single word verb convention with “acceptable verbs” ConvertTo and ConvertFrom (ConvertTo-SecureString, ConvertFrom-Json), which are the only exception to one word verbs before the dash.

              Function names are definitely one of my biggest peeves with it.

              Additionally, their basic comparison operators are dumb as hell. How is “-le” better or clearer in meaning that “<=”? -ne instead of !=, but == isn’t just -e, it’s -eq. And you can’t slap an n in front of other comparators for not, -nle isn’t a thing. You gotta wrap the whole comparison in parentheses and slap an ! on the front or slap -not in front. But don’t try to do !-le, because that’s also not a thing. It’s not terrible but I refuse to believe that -eq is more readable than ==

              • @______@lemm.ee
                link
                fedilink
                12 years ago

                Functionally speaking, PS is a really good shell language. Its minor things about it that I dont enjoy. As you said, it feels like the language design has some poor decisions.

        • @hemko@lemmy.dbzer0.com
          link
          fedilink
          English
          3
          edit-2
          2 years ago

          Not gonna lie I love easily readable scripts. Powershell was my first, and as much pain it can be it’s for sure readable even for the most novice.

          Maybe that’s why I love Python too, but have hard time learning sh past very basics…

          Edit: oh lol that’s a fork bomb, curiosity won and had to ddg what that is. Love the simplicity of that