Possible Script?

Ok here is what I want to do. I do a report in ghost and it goes into a text file, containing pc information. From there I want to put it into a database. The report file looks like this
ram: 256
model: HP

Is there some kind if script I can make that would put it into an access or excel database? I have done some coding with VB in excel once before. Does this seem like a hard task? Is there a better soultion?

Basicly the norton report is way to big, it was 8 pages with only 15 computer and there is no way to shorten it down. This way we can track our computers information easily.


OSNN Junior Addict
Put this into a file with the extension ".vbs"

On Error Resume Next
strComputer = "."
Set objWMIService = GetObject("winmgmts:\\" & strComputer & "\root\cimv2")
Set colItems = objWMIService.ExecQuery("Select * from Win32_ComputerSystem",,48)
For Each objItem in colItems
Wscript.Echo "Manufacturer: " & objItem.Manufacturer
Wscript.Echo "Model: " & objItem.Model
Wscript.Echo "Name: " & objItem.Name
Wscript.Echo "TotalPhysicalMemory: " & objItem.TotalPhysicalMemory

There are hundreds of other things you can find with vbs, they might be in different objects. Let me know if you can't get other information.



OSNN Junior Addict
Forgot to mention. If you want, you can create a new file with the extension ".csv" that is comma delimited. This will create an excel file that is nice and organized.

hey thanks that will work for another project. Here is what I am trying to do...

If you see the attached file, I want to put that into a database. I am trying to figure out a way to sort it so I can. You have any ideas?

Thanks for the help.



OSNN Junior Addict

I don't know an easy way. You may have to organize all of your machines into one excel file. Then you can create a blank database and import the excel file using the file drop down menu. (Assuming you are using excel). I will take some messing around with to get the import to work right. Your excel file might have to be set up like this (all computers in one sheet):

Computer IPAddress .......
lab-02 654.654.64.654......
lab-03 654.654.64.654......

yeah, my main problem is we will be running reports more than once and want to make a short process to add data. Just wondering maybe in excel to code it VB to sort the data.


OSNN Junior Addict
That is not easy. If all of the computers connected to a domain, you could create a group policy to run a scrip on everyones computer when they login. This script would map a drive, create a text file (named by the mac address because its unique), write the information to the text file and disconnect the drive. That way you have a network share consisting of all of the machines and their respective information.

Then a small VB application can open each text file and import the data into access once a night. This is the way I proposed to my boss but....viruses and spam have taken priority.

I have tried to find simpler ways to develop an accurate inventory without any luck. I would guess it would take 40hrs to perfect the process if you don't have alot of VB experience.

Let me know if you find another solution.

Its ran on norton ghost and will get the inventory, then is exported to a text file, from there I want to sort it in a database. From the text file I imported it to excel. Now I want to put that information into a data base. i.e. access.


OSNN Junior Addict
it seems you really only have the option I mentioned above. Write a small vb application that will open the comma delimited excel files (assuming from your other posts) and import it into access. Its much simpler than trying to continually import by hand or trying to get VBA to manipulate the data in excel and import it into access.

The program would be very small. If you go that route, Tutorials dealing with "sequential file access" and "database connections" would be helpful. Otherwise I don't have any other ideas.



Political User
At school they runa small C++ app, that reports:

IP adress, Mac Adress, login date, username, computer stats.

Once you log out, it runs another tool, to add an logout entry, this time also IP adress, mac ardress, logout date, and username but no computer stats.

They have a database with all the Mac's to show where the Machine should be located, if we cannot locate it, they run a little app on that designated machine, that makes it ping its first uplink router, router logs this, and we know which floor its on. Now we enter room by room and look for the box.

Members online

No members online now.

Latest posts

Latest profile posts

Perris Calderon wrote on Electronic Punk's profile.
Ep, glad to see you come back and tidy up...did want to ask a one day favor, I want to enhance my resume , was hoping you could make me administrator for a day, if so, take me right off since I won't be here to do anything, and don't know the slightest about the board, but it would be nice putting "served administrator osnn", if can do, THANKS

Been running around Quora lately, luv it there https://tinyurl.com/ycpxl
Electronic Punk wrote on Perris Calderon's profile.
All good still mate?
Hello, is there anybody in there? Just nod if you can hear me ...
What a long strange trip it's been. =)

Forum statistics

Latest member