1.    22 Sep 2015 #1
    Join Date : Jun 2015
    Posts : 6
    Win 10 pro 64 bit

    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.)
      My System SpecsSystem Spec

  2.    23 Sep 2015 #2
    Join Date : Oct 2013
    A Finnish ex-pat in Germany
    Posts : 8,695
    Windows 10 Pro

    I recommend you start with this: Windows PowerShell: Scripting Crash Course | TechNet Magazine. Read it through, it's not too complicated and with your batching background you get it.

    When done continue with this: Conditional Logic Using Loops | PowerShell Pro! :: PowerShell Pro!

      My System SpecsSystem Spec

  3.    23 Sep 2015 #3
    Join Date : Jun 2015
    Posts : 6
    Win 10 pro 64 bit

    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)
      My System SpecsSystem Spec

  4.    23 Sep 2015 #4
    Join Date : Apr 2014
    Space coast of Florida
    Posts : 3,789
    Windows 10 Pro X64 14393.105

    Two great links, thanks Kari.
      My System SpecsSystem Spec


Similar Threads
Thread Forum
A simple Guest account?
Hi Guys, I've upgraded to Windows 10 and want a simple Guest account for visitors. The only add users options I have involve my visitors setting up email accounts, etc, which defeats the object of a simple Guest account. I've looked online...
User Accounts and Family Safety
Solved PCI simple communications controller driver not found.
I'm trying to figure out what this PCI simple communications controller is and where can I download the driver for it. I've tried updating it from the device manager, but it tells me driver could not be found and a yellow exclamation icon appears in...
Drivers and Hardware
A simple fix for alot of Windows 10 issues
Since Windows 10 came out alot of people have had issues concerning alot of aspects in Windows 10, i have been serving ppl as a free tech supporter and i thought to include some fixes here, alot of ppl are panicking, and avoid going to a service...
Performance & Maintenance
Solved Is uninstall of Win 10 as simple as...?
Don't panic! :huh: I'm not ready to uninstall Windows 10 just yet but will need to eventually. But, to finish my question; is uninstall of Win 10 as simple as booting into Windows 7, then deleting the Windows 10 partition & re-acquiring that space...
Installation and Setup
Our Sites
Site Links
About Us
Windows 10 Forums is an independent web site and has not been authorized, sponsored, or otherwise approved by Microsoft Corporation. "Windows 10" and related materials are trademarks of Microsoft Corp.

Designer Media Ltd
All times are GMT -5. The time now is 11:17.
Find Us
Twitter Facebook Google+

Windows 10 Forums