How to write scripts in Windows 7

In this tutorial, we are covering both PowerShell basics and batch basics. First let’s deal with PowerShell scripting. To write scripts in Windows 7, follow the steps provided in this tutorial.


Steps to write scripts in windows 7

1. Step First let’s open Windows PowerShell Integrated Scripting Environment (ISE), where you can write scripts. Alternatively, you can simply write in notepad and save as .ps1 extension. Click on the Start and type powershell in the ‘Search programs and files text box’. Then click Windows PowerShell ISE.


2. Step Now, Windows PowerShell Integrated Scripting Environment (ISE) opens


3. Step Now we are typing a basic script. To check processes that is running in your Windows 7, type Get-Process. For more instructions, examples on PowerShell scripting visit


4. Step Click on the File >> Save.


5. Step In the Save dialog box, give the file name. In my case, i gave a1 and click Save.


6. Step Now to execute, the written PowerShell script, Click on the Start and type powershell in the ‘Search programs and files text box’. Then click Windows PowerShell.


7. Step Then Windows PowerShell opens. Type the complete path along with file name and extension of the script that you have just created.


8. Step Finally your script executes. Just incase, if you have problem executing script then there might be a permission issue. Please refer for editing permissions.


9. Step Let’s go to the another part of the tutorial. We shall create simple batch to do some task automatically. To create a simple batch file, Click on the Start and type notepad in the ‘Search programs and files text box’. Then press enter or click notepad.


10. Step Now notepad opens.We shall create a simple batch file to display files and folder inside c:\ drive in your Windows 7.
Type following:

dir c:\



11. Save the file by clicking File >> Save, give the file name. In my case, i gave testing.bat and click Save. Make sure you give extension as .bat otherwise it will be saved as text by default.


12. Now locate the file and double click on it to open it.


13. Finally, your batch file executes. That are the complete steps.


Windows PowerShell is Microsoft’s task automation framework, consisting of a command-line shell and associated scripting language built on top of, and integrated with the .NET Framework. PowerShell provides full access to COM and WMI, enabling administrators to perform administrative tasks on both local and remote Windows systems.

Simiarly, a batch file is a text file which contains series of commands intended to be executed by the command interpreter in DOS, OS/2, and Microsoft Windows. Batch files are useful for running a sequence of executables automatically and are often used to automate repetitive or tedious processes.


4 of 5 0 (80%) 3 votes
- Cheers!

Written by:
Uttam is a Microsoft Student Partner from Kathmandu, Nepal. Aside from blogging, Uttam is also studying computer engineering and works as a freelancer developer. Windows has always been his first love. He has been using Windows since his early days since he was in 2nd Grade. He also used a few other operating systems but never found any other OS that he grew fond of.

Contact The Author:

Get Free Help

Connect With Our Site:



Need help? Ask a question at our QA site, click the red button to get started:
Want to support us? Great, simply buy your favorite games from G2A via our referral link ( and save money at the same time:

Leave a Reply

Your email address will not be published. Required fields are marked *

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>

Current day month ye@r *