Command line help in Windows
Hey guys,
I am trying to do a simple command line in Windows to get the system info for all my machines. I plan on piping them a text file in a public share by their computer name, but I am having trouble doing this. I plan on then moving this over to the netlogon script so that each computer will create this file the next time they log on, and I can tell who is who by their computer's name.
I was able to get this line working but I would like the hostname instead of the user name. I just don't what to put in. I would leave it as username, except some users have two pc's.
systeminfo > s:\systeminfo\%username%.txt
*please note- s:\systeminfo is a folder I have on a public share
I am trying to do a simple command line in Windows to get the system info for all my machines. I plan on piping them a text file in a public share by their computer name, but I am having trouble doing this. I plan on then moving this over to the netlogon script so that each computer will create this file the next time they log on, and I can tell who is who by their computer's name.
I was able to get this line working but I would like the hostname instead of the user name. I just don't what to put in. I would leave it as username, except some users have two pc's.
systeminfo > s:\systeminfo\%username%.txt
*please note- s:\systeminfo is a folder I have on a public share
Comments
-
HeroPsycho Inactive Imported Users Posts: 1,940What system information are you looking for?
*getting ready to bust out some Powershell commands*Good luck to all! -
vCole Member Posts: 1,573 ■■■■■■■□□□HeroPsycho wrote: »What system information are you looking for?
*getting ready to bust out some Powershell commands*
Such a PoSH whore HP!
but seriously, PoSH ftw -
katakatak Member Posts: 50 ■■□□□□□□□□Awesome! %computername% worked out fine. I was trying %hostname% but that would just name the file '%hostname'. I think that PowerShell might be overkill, but then again I've never used it. I just was looking for the system information of all the computers. This is a pretty easy way to keep inventory, or if I ever needed information on the computer's hardware without having to go around to the computers.
-
HeroPsycho Inactive Imported Users Posts: 1,940Awesome! %computername% worked out fine. I was trying %hostname% but that would just name the file '%hostname'. I think that PowerShell might be overkill, but then again I've never used it. I just was looking for the system information of all the computers. This is a pretty easy way to keep inventory, or if I ever needed information on the computer's hardware without having to go around to the computers.
You can get all that with get-wmiobject and create csv spreadsheet friendly reports.Good luck to all! -
Nuwin Member Posts: 75 ■■□□□□□□□□I use Spiceworks for my computer invetory needs. It can record some reasonably detailed information and is free."By the power of Grayskull"
-
HeroPsycho Inactive Imported Users Posts: 1,940deadpool287 wrote: »what do you recommend on learning powershell?
For admins, if you got $30, PowerShell TFM 2nd Edition.
If you don't have money, PowerShell Pro!Good luck to all! -
someeh Member Posts: 143I use Spiceworks for my computer invetory needs. It can record some reasonably detailed information and is free.
just downloaded this, seems to work pretty good. -
HeroPsycho Inactive Imported Users Posts: 1,940New Powershell free ebook out. Check it out!
Master-PowerShell | With Dr. Tobias Weltner - PowerShell.comGood luck to all! -
katakatak Member Posts: 50 ■■□□□□□□□□I had fooled around with Spiceworks before in the past, but I wasn't really satisified. It didn't seem to find all my computers, and that actually made me work more trying to figure out which one wasn't found. I'll try giving PowerShell Pro a shot, but just wanted to know a bit about what it exactly is. Just a shell to run VB commands?
-
HeroPsycho Inactive Imported Users Posts: 1,940I had fooled around with Spiceworks before in the past, but I wasn't really satisified. It didn't seem to find all my computers, and that actually made me work more trying to figure out which one wasn't found. I'll try giving PowerShell Pro a shot, but just wanted to know a bit about what it exactly is. Just a shell to run VB commands?
It's both an interactive shell and scripting language that is object oriented. You can use VB commands and DOS commands in PoSh, but PoSh itself is neither of those.Good luck to all!