Windows 10: How to use Powershell for simple CMD tools

Discus and support How to use Powershell for simple CMD tools in Windows 10 Support to solve the problem; I am by no standard a programmer. But in the past, I had a job with a lot of skutwork needed on a daily basis. I.T. was always too busy, and non-I.T.... Discussion in 'Windows 10 Support' started by periboob, Sep 22, 2015.

  1. periboob Win User

    How to use Powershell for simple CMD tools


    I am by no standard a programmer. But in the past, I had a job with a lot of skutwork needed on a daily basis. I.T. was always too busy, and non-I.T. folks were not allowed to do any programming, but the command line and batch stuff was not real programming and was OK for ordinary folks. So, I learned batch, out of necessity over 20 years ago, and became addicted. I would not even dabble with Powershell, except that it has a feature that is frustratingly missing in CMD.exe--Powershell has a command line history that is preserved between sessions.

    I have a toolkit full of little batch files that continue to make my day more comfortable, many run from shortcut icons, but many from the command-line. Many of the DOS commands work just fine in Powershell, but one which I use extensively fails. FOR throws an error. e.g.

    for /f %i in (alpha.txt) do f ...%i%i......

    where "F" is a small batch that I wrote, runs fine at the CMD prompt, but FOR creates confusion for Powershell.

    Any suggestion how I can configure Powershell to treat FOR like a CMD command? (hopefully without going too far into the mysteries of real Powershell lingo.)

    :)
     
    periboob, Sep 22, 2015
    #1

  2. Windows 10 License Problem.

    Right-click Start>Command Prompt-Admin and type in the following command:

    slmgr.vbs /dlv

    You will get a window, take a screenshot using snipping tool and paste it in next reply.

    (If you see powershell instead of cmd then first type in cmd in powershell and then proceed)
     
    Sumit Dhiman2, Sep 22, 2015
    #2
  3. Use powershell alone or also CMD & new task?

    Windows 10

    I noted that in many cases the same command can be launched via Powershell, CMD or task manager/new task.

    In all cases it is better to just use Powershell or the other ways have their advantages in specific cases?

    Thanks
     
    arturoruiznerv, Sep 22, 2015
    #3
  4. Kari Win User

    How to use Powershell for simple CMD tools

  5. periboob Win User
    Thanks Kari. I had composed a long-winded tirade about Powershell and all its irritations, but you got me within sight of my objective. After I had vented, I clicked "Mark Solved" and the forum lost my train of thought. (probably better that way)
     
    periboob, Sep 23, 2015
    #5
  6. Ztruker Win User
    Two great links, thanks Kari.
     
    Ztruker, Apr 4, 2018
    #6
Thema:

How to use Powershell for simple CMD tools

Loading...
  1. How to use Powershell for simple CMD tools - Similar Threads - Powershell simple CMD

  2. How to Restart WSL using PowerShell, CMD, Task Manager

    in Windows 10 News
    How to Restart WSL using PowerShell, CMD, Task Manager: [IMG]WSL or Windows Subsystem Linux is a built-in feature that helps run a Linux environment on a Windows 10/11 machine without using any dual-boot setup or virtual machine. Restarting WSL can be a convenient and time-efficient way to reboot or reinitialize the Linux instance...
  3. Enable Tamper Protection Using PowerShel or CMD

    in Windows 10 Gaming
    Enable Tamper Protection Using PowerShel or CMD: How to activate Tamper Protection using Powershell or Command Line? https://answers.microsoft.com/en-us/windows/forum/all/enable-tamper-protection-using-powershel-or-cmd/bf2364f0-d0e7-4806-aca7-5cd860fe4bf7
  4. Enable Tamper Protection Using PowerShel or CMD

    in Windows 10 Software and Apps
    Enable Tamper Protection Using PowerShel or CMD: How to activate Tamper Protection using Powershell or Command Line? https://answers.microsoft.com/en-us/windows/forum/all/enable-tamper-protection-using-powershel-or-cmd/bf2364f0-d0e7-4806-aca7-5cd860fe4bf7
  5. Enable Tamper Protection Using PowerShel or CMD

    in AntiVirus, Firewalls and System Security
    Enable Tamper Protection Using PowerShel or CMD: How to activate Tamper Protection using Powershell or Command Line? https://answers.microsoft.com/en-us/windows/forum/all/enable-tamper-protection-using-powershel-or-cmd/bf2364f0-d0e7-4806-aca7-5cd860fe4bf7
  6. How to delete .lnk files using CMD or Powershell?

    in Windows 10 Gaming
    How to delete .lnk files using CMD or Powershell?: I want to delete two shortcuts in my desktop using powershell or cmd but each of them doesn't recognize them. when I enter `dir` in both cmd and pwsh, they jusy not show the shortcuts. it seems like they are ghosts. how can I make to fix this?...
  7. How to delete .lnk files using CMD or Powershell?

    in Windows 10 Software and Apps
    How to delete .lnk files using CMD or Powershell?: I want to delete two shortcuts in my desktop using powershell or cmd but each of them doesn't recognize them. when I enter `dir` in both cmd and pwsh, they jusy not show the shortcuts. it seems like they are ghosts. how can I make to fix this?...
  8. CMD and Powershell RUSH

    in Windows 10 Network and Sharing
    CMD and Powershell RUSH: Hi mods,My Windows 10 is running cmd and power shell automatically even though I didn't open them. Some errors are popping up and browsers are closing automatically. I captured the picture with my phone because it also freezes my pc mouse. Please help....
  9. Settings using powershell/cmd?

    in Windows 10 Performance & Maintenance
    Settings using powershell/cmd?: Is there a way to manage settings using command line/powershell? Thanks. 124376
  10. CMD and PowerShell

    in Windows 10 BSOD Crashes and Debugging
    CMD and PowerShell: Hi all, I run Windows 10, v 1803. Clicking Start, typing CMD, there is only "Command Prompt (desktop application)". Win key + X shows "Windows PowerShell" and "Windows PowerShell (Admin)". If after Win key+R I choose Windows PowerShell" pops up a message: Same with...