What tools and languages are available for windows shell scripting?

后端 未结 12 1342
孤独总比滥情好
孤独总比滥情好 2021-01-21 01:28

I want to know what are the options to do some scripting jobs in windows platform. I need functionality like file manipulations, registry editing etc. Can files be edited using

12条回答
  •  情歌与酒
    2021-01-21 02:04

    Powershell can do what you need.

    file manipulations

    This SO post answers how you can replace a string in your text file. Pasting it here for easy reference:

    (Get-Content c:\temp\test.txt).replace('[MYID]', 'MyValue') | Set-Content c:\temp\test.txt

    There are other things that you can do, such as copying files and folders. You can find out more on the Windows Powershell Documentation

    registry editing

    This can be easily done using Powershell. Here's a sample code from Microsoft Dev Blogs:

    Set-ItemProperty -Path HKCU:\Software\hsg -Name newproperty -Value anewvalue

提交回复
热议问题