Solved

Windows XP Pro. WSH Startup script

Posted on 2007-03-28
2
788 Views
Last Modified: 2012-08-13
I need to capture Physical memory of aproximately 200 Windows XP pro machines.  I would like to use a startup script for this.  If the script would collect the Machine name and amount of memory installed then append it to a text file stored on the server would be the ideal way.  I have looked at a few scripts, and I know the variables are available to gather the machine name and amount of memory.  Howver I can't figure out hoe to append it to a text file.
0
Comment
Question by:colonytire
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
2 Comments
 
LVL 12

Expert Comment

by:alandc
ID: 18810654
It sounds like you have most of the script worked out. For issues like this it is better that each machine write a file of it's own named by the machine name.  Otherwise you will have multiple entries for each machine (as each is appended the file gets larger and duplicates are NOT elminated) and you will have problems with the file locking on the server.

Instead have each PC write the file MACHINE_NAME.txt to the local drive then copy it to a server share (overwriting automatically any existing file).  To bring all of them together on the server into one file is a simple and quick command that can be run on demand when needed on the server.

I suggest you ask your question again in a script forum if you desire code samples.
0
 
LVL 67

Accepted Solution

by:
sirbounty earned 250 total points
ID: 18810675
Const ForAppend=8

Dim objFSO:Set objFSO=CreateObject("Scripting.FileSystemObject")
Dim objOutput: Set objOutput=objFSO.OpenTextFile("\\server\share\collection.txt", ForAppend)
Dim objWMI:Set objWMI = GetObject("winmgmts:{impersonationLevel=impersonate}!\\.\root\cimv2")
Set colData = objWMI.ExecQuery ("Select * from Win32_ComputerSystem")
For Each objData in colData
  objOutput.WriteLine objData.Name & "," & objData.TotalPhysicalMemory
Next
objOutput.Close
Set objWMI=Nothing
Set objOutput=Nothing
Set objFSO=Nothing
WScript.Quit
0

Featured Post

Turn Insights Into Action

You’ve already invested in ITSM tools, chat applications, automation utilities, and more. Fortify these solutions with intelligent communications so you can drive business processes forward.

With xMatters, you'll never miss a beat.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Configuring Remote Assistance for use with SCCM
Sometimes clients can lose connectivity with the Lotus Notes Domino Server, but there's not always an obvious answer as to why it happens.   Read this article to follow one of the first experiences I had with Lotus Notes on a client's machine, my…
This video Micro Tutorial explains how to clone a hard drive using a commercial software product for Windows systems called Casper from Future Systems Solutions (FSS). Cloning makes an exact, complete copy of one hard disk drive (HDD) onto another d…
Windows 8 comes with a dramatically different user interface known as Metro. Notably missing from the new interface is a Start button and Start Menu. Many users do not like it, much preferring the interface of earlier versions — Windows 7, Windows X…

695 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question