I started a new job at a hospital where we have to survey and document all the old PCs, then xfer data, mapped drives, etc to the new ones.
So far Ive come up with a couple good ones with my limited knowledge, like this lil ditty
@echo off
copy \\lhhds3200\data\is\!base.txt \\lhhds3200\data\is\%computername%-base.txt
"C:\Program Files\Common Files\Microsoft Shared\MSInfo\msinfo32" /report \\lhhds3200\data\is\%computername%-msinfo.txt /categories +pewpew
ipconfig /all >> "\\lhhds3200\data\is\%computername%-ipconfig.txt"
dir /B "C:\Documents and Settings\All Users\Desktop" >> "\\lhhds3200\data\is\%computername%-info.txt"
net use >> "\\lhhds3200\data\is\%computername%-info.txt"
wmic bios get serialnumber >> "\\lhhds3200\data\is\%computername%-serial.txt"
type \\lhhds3200\data\is\%computername%-serial.txt >> \\lhhds3200\data\is\%computername%.txt
type \\lhhds3200\data\is\%computername%-base.txt >> \\lhhds3200\data\is\%computername%.txt
type \\lhhds3200\data\is\%computername%-msinfo.txt >> \\lhhds3200\data\is\%computername%.txt
type \\lhhds3200\data\is\%computername%-ipconfig.txt >> \\lhhds3200\data\is\%computername%.txt
type \\lhhds3200\data\is\%computername%-info.txt >> \\lhhds3200\data\is\%computername%.txt
del \\lhhds3200\data\is\%computername%-serial.txt
del \\lhhds3200\data\is\%computername%-base.txt
del \\lhhds3200\data\is\%computername%-msinfo.txt
del \\lhhds3200\data\is\%computername%-ipconfig.txt
del \\lhhds3200\data\is\%computername%-info.txt
Note the pew pew. Anyways that spits out a copy of a base txt, which I set the department info , user contact #s, etc. then it adds in the system summary from msinfo32, ipconfig, mapped drives, shortcuts in the all users/desktop, and if admin rights were on, the serial.
I noticed I can remotely wmic the serial from my terminal or just write it down from side of the system.
Now I need a list of users, so I was thinking just to output the contents of c:\documents and settings. that would also list the date. My question is is there a way to remotely run this so it can name the txt from the target machine? Because Ill just assume computername will name it from the one executing the command, not the target. For now Im just guessing to just edit the batch and put the hostname name as target and then output filename.
basically I want to know how to set my own variable
i want to make it like users.bat, and be able to type users MEDICAL2 and have it auto set MEDICAL2 for target host and then file name.
_________________________