
Data Structure
Networking
RDBMS
Operating System
Java
MS Excel
iOS
HTML
CSS
Android
Python
C Programming
C++
C#
MongoDB
MySQL
Javascript
PHP
- Selected Reading
- UPSC IAS Exams Notes
- Developer's Best Practices
- Questions and Answers
- Effective Resume Writing
- HR Interview Questions
- Computer Glossary
- Who is Who
Open Any File with Default Application Using 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
Advertisements