Copy A path in powershell that it generates

14 Views Asked by At

4.1 when you run

PS C:\Users\tjhopkin> powercfg /batteryreport

---IT creates the path bellow----

Battery life report saved to file path C:\Users\tjhopkin\battery-report.html.

I want to create a line in power shell that will copy that line then start it to open it right away for any computer - the paths change per computer. So the next line of code needs to copy that path then the next needs to start that path.

I have gotten it to work for my computer using me adding the path fisacaly but every computer saves paths differently and in deferent locations.

Please help.

0

There are 0 best solutions below