When the administration and support management of Windows 10 operating systems is within our roles, we know very well that the use of commands is a practical task to solve problems, analyze configurations or obtain information on aspects of both the system and its applications or internal components . These commands have been developed with the purpose of accessing the best details of each function for which they were created..
An additional task to improve the use and management of these commands is the possibility of exporting the result directly to a text file , this is essentially useful for much more direct support or control tasks since on the text file we can better visualize the results to detect where the root of the problem is and thus take the corresponding measures.
TechnoWikis will explain through this tutorial how we can export the results executed both in the command prompt and in Windows PowerShell to a text file and thus be able to improve our tasks on Windows 10..
To keep up, remember to subscribe to our YouTube channel! SUBSCRIBE
1. How to export commands in CMD Windows 10
The symbol of the Windows 10 system is the console that has been present for several decades, and will still be, for the execution of various tasks in Windows 10, whether it is the execution of orders, access to information, updating of components and many tasks. plus.
Step 1
To access the command prompt in Windows 10 we have the following options:
To keep up, remember to subscribe to our YouTube channel! SUBSCRIBE
Note
It is recommended that we access as administrators to export the results.
Step 2
Once there, the syntax for executing and exporting the result in txt is as follows:
Command> Unit: \ "Path" .txt
Step 3
For example, we will execute the "nslookup" command in a normal way and then we will export its result to the following path.
C: \ CMD \ CMD.txt
Step 4
With this syntax we can see that the result will be exported directly to the TXT file:
Step 5
We proceed to open the text file and there we will find the result of the command executed:
Step 6
We can apply this for any command to execute in CMD:
Step 7
The final result in the text file will be:
Note
If we want the result to also be displayed in the terminal, we will execute the following:
Command> Unit: \ "Path" .txt | type Unit: \ "Path" .txt
2. How to export commands in Windows PowerShell Windows 10
Windows PowerShell is one of the most powerful consoles that Microsoft has developed for support tasks since it has numerous cmdlets that allow access to detailed information, as well as execute multiple tasks there.
Step 1
For this purpose we must access Windows PowerShell as administrators and in the console we will execute the following syntax:
Command | Out-File -FilePath c: \ ”Path” .txt
Step 2
For example, we will execute the following:
Get-Service | Out-File -FilePath C: \ CMD \ PowerShell.txt
Step 3
Now, in the indicated path we will see the text file that has been exported:
Step 4
When we open it we find the result of the Get-Service cmdlet which will display all the active services of the system:
Step 5
We can see the content of the exported result through PowerShell we can do it using the Get-Content cmdlet like this:
Get-Content -Path C: \ CMD \ PowerShell.txt
We can see how these simple methods allow us to export these results and thus have better control over them..