- Trending Categories
Data Structure
Networking
RDBMS
Operating System
Java
MS Excel
iOS
HTML
CSS
Android
Python
C Programming
C++
C#
MongoDB
MySQL
Javascript
PHP
Physics
Chemistry
Biology
Mathematics
English
Economics
Psychology
Social Studies
Fashion Studies
Legal Studies
- Selected Reading
- UPSC IAS Exams Notes
- Developer's Best Practices
- Questions and Answers
- Effective Resume Writing
- HR Interview Questions
- Computer Glossary
- Who is Who
How to open any file with its default application with PowerShell?
To open any file using its default application, we can use the Invoke-Expression command. For example, we want to open a file on the C:\temp and the file name is NewUsers.CSV then you can run the below command.
Invoke-Expression C:\Temp\NewUsers.csv
The above command will open the file from that location. If the default application is not set then Windows will ask for the default application to select.
If you know any application name and which can be opened with the shortcut then you can directly type the name of the application. For example, Notepad.exe, Calc.exe
Generally, they can be opened directly but this command also helps to open the application as shown below.
PS C:\> Invoke-Expression notepad.exe PS C:\> Invoke-Expression calc.exe
- Related Articles
- How to create a dummy file of any size with PowerShell?
- How to open chrome default profile with selenium?
- Open a file browser with default directory in JavaScript and HTML?
- How to open a file in binary mode with Python?
- How to open a file in append mode with Python?
- How to open a website in Android’s web browser from any application?
- How to open a binary file in append mode with Python?
- How can I open a VDS file with three js?
- How to open a file in read and write mode with Python?
- How to open a binary file in read and write mode with Python?
- How to open an Excel file with PHPExcel for both reading and writing?
- How to open hidden file using C#?
- How to convert JSON file to CSV file using PowerShell?
- How to create new alias with PowerShell?
- How to Install Windows Features with PowerShell?

Advertisements