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

Bring active cell back into view
Start at A1 and select to A9999 while writing a formula, you can't see A1 anymore. Press Ctrl+Backspace to bring active cell into view.
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,223,898
Messages
6,175,272
Members
452,628
Latest member
dd2

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