Options

Command line help in Windows

katakatakkatakatak Member Posts: 50 ■■□□□□□□□□
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

Comments

  • Options
    kalebkspkalebksp Member Posts: 1,033 ■■■■■□□□□□
    %computername%
  • Options
    NetwurkNetwurk Member Posts: 1,155 ■■■■■□□□□□
    kalebksp wrote: »
    %computername%

    hostname also works on some of the windows OSes
  • Options
    HeroPsychoHeroPsycho Inactive Imported Users Posts: 1,940
    What system information are you looking for?

    *getting ready to bust out some Powershell commands*
    Good luck to all!
  • Options
    vColevCole 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
    icon_thumright.gif
  • Options
    HeroPsychoHeroPsycho Inactive Imported Users Posts: 1,940
    You'll be a PoSh addict, oh yes, you will!
    Good luck to all!
  • Options
    katakatakkatakatak 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.
  • Options
    HeroPsychoHeroPsycho Inactive Imported Users Posts: 1,940
    katakatak wrote: »
    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.

    You can get all that with get-wmiobject and create csv spreadsheet friendly reports.
    Good luck to all!
  • Options
    NuwinNuwin 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"
  • Options
    deadpool287deadpool287 Member Posts: 113
    what do you recommend on learning powershell?
  • Options
    HeroPsychoHeroPsycho Inactive Imported Users Posts: 1,940
    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!
  • Options
    someehsomeeh Member Posts: 143
    Nuwin wrote: »
    I 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.
  • Options
    HeroPsychoHeroPsycho Inactive Imported Users Posts: 1,940
    New Powershell free ebook out. Check it out!

    Master-PowerShell | With Dr. Tobias Weltner - PowerShell.com
    Good luck to all!
  • Options
    katakatakkatakatak 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?
  • Options
    HeroPsychoHeroPsycho Inactive Imported Users Posts: 1,940
    katakatak wrote: »
    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?

    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!
Sign In or Register to comment.