Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations bkrike on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Getting OS from a script

Status
Not open for further replies.

spaceuk

MIS
Oct 13, 2001
14
GB
I need to get a list of what OS users have, is there a way to get this information using a login script and send it to a file?

I want to do this through a script because we arent using the zen inventory procedure

any help would be much appreciated
 
We've used regedit commands run via the login script to write the computer name from the registry to a text file, you could do the same but write the name to a text file based on the OS? e.g. if %OS = "WINNT" then . . .

You can't differenciate between NT 4 and Win2k unless you look at the version, Win2k is WINNT 5 and above.

Hope this is useful...
 
thanx for your help chunk... could you tell me how you write something to a text file im only a beginner at scripting... an example would be great if you wouldnt mind.. thanx again for your help
 
Hi,

Here's what we did...

Create a folder somewhere, ours is on VOL1 and give the users rights (RWCM) and put a space restriction on it.

In there, we put regedit (in case it's not on the PCs) and a batch file. The batch file goes like:

START /w REGEDIT /e %temp%.\tmp.txt HKEY_LOCAL_MACHINE\System\CurrentControlSet\Control\ComputerName\ComputerName

MAP ROOT H:=SERVERNAME\VOL1:\LOGS

TYPE %temp%\TMP.TXT >>h:\COMP-NAME.TXT

EXIT

This pipes out the key specified to tmp.txt, then this is written up to the server, appended to a file called COMP-NAME.TXT

Hope this helps . . .
 
Sorry, forgot, we call the batch file from the login script then, just #H:\COMPUTERNAME.BAT or whatever you call the file. The map root h:=. . . . that i put in the batch file above needs to be in the script...
 
Im going to give it a go now... thanks for all your help chunk
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top