Systeminfo login script RRS feed

  • General discussion

  • Hi,

    I wonder if anyone can help.

    I am trying to create a Windows batch login script that collects each user's system info and username/computername and outputs it to one log file (rather than a separate file created for each user). So I need something like echo %username%-%computername% >> file.txt and systeminfo|find /i "original" >> file.txt, which I managed to do with something like this:

    systeminfo|find /i "original" >> \\share\sysinfo.log
    echo %username%-%computername% >>\\share\user.log
    type \\share\user.log > \\share\Results\systeminfo.log 
    type \\share\sysinfo.log >> \\share\Results\systeminfo.log

    Every time someone logs on, it outputs to one file, but the username and systeminfo are separated. I need them to output into a separate columns, for example:

    Username-ComputerName Original Install Date Jo-PC1 17/16/2016, 09:14:34 Dan-PC2 17/03/2015, 11:00:05

    • Changed type Bill_Stewart Wednesday, September 13, 2017 8:50 PM
    • Moved by Bill_Stewart Wednesday, September 13, 2017 8:51 PM Abandoned
    Wednesday, July 19, 2017 10:30 AM

All replies

  • This is not recommended, as multiple simultaneous logons will conflict with writes to the same file.

    Why do you need to record computer data when users log on? You can run systeminfo against a remote computer any time you need the information.

    -- Bill Stewart [Bill_Stewart]

    Wednesday, July 19, 2017 12:22 PM
  • Thanks, I thought as much. Not sure why the client wants this. He always asks for weird things, haha.
    Wednesday, July 19, 2017 12:36 PM