Power shell script

Trevor3007

Well-known Member
Joined
Jan 26, 2017
Messages
675
Office Version
  1. 365
Platform
  1. Windows
Hi ,

Can some knowledge person provide me with a script that will out put the following to a text file (c:\compdetails.tct).
Hostname
IP address
Sub mask
Gateway
Serial number

I can get only serial number but cannot get any others or to output it to text file

Many many thanks 🙏
 

Excel Facts

How to create a cell-sized chart?
Tiny charts, called Sparklines, were added to Excel 2010. Look for Sparklines on the Insert tab.
Is this what you are looking for?

Code:
&{
    wmic bios get serialnumber
    ipconfig /all
} 2>&1 c:\compdetails.txt
 
Upvote 0
thank you so much for your help.


I dont get any errors, but it does not output to c:\compdetails.txt /
Searched my HD, but still no find.

Plus is it possible ONLY to output:-
Hostname
IP address
Sub mask
Gateway
Serial number

as on screen it displays all via ipconfig.


thank you again for your help.
 
Upvote 0
I know. I'm not an expert. But if you run it in PowerShell, i.e. copy and paste, it works. But if you click on the file and it run, it doesn't for some reason.
 
Upvote 0
I know. I'm not an expert. But if you run it in PowerShell, i.e. copy and paste, it works. But if you click on the file and it run, it doesn't for some reason.
Just copied and pasted from Mr excel.
🤔
 
Upvote 0

Forum statistics

Threads
1,224,824
Messages
6,181,186
Members
453,020
Latest member
Mohamed Magdi Tawfiq Emam

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top