Possible Script?

omg its nlm

lvl 17 Hax
Joined
10 Jan 2004
Messages
1,829
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
------
computername
-----
ram: 256
model: HP
Ect
----

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.
 
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
Next
''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''

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.

Dan
 
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.

Dan
 
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.
 

Attachments

  • excel.JPG
    excel.JPG
    83 KB · Views: 119
Scriptomatic

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......

Dan
 
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.
 
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.

Dan
 
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.
 
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.

Dan
 
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 profile posts

Also Hi EP and people. I found this place again while looking through a oooollllllldddd backup. I have filled over 10TB and was looking at my collection of antiques. Any bids on the 500Mhz Win 95 fix?
Any of the SP crew still out there?
Xie wrote on Electronic Punk's profile.
Impressed you have kept this alive this long EP! So many sites have come and gone. :(

Just did some crude math and I apparently joined almost 18yrs ago, how is that possible???
hello peeps... is been some time since i last came here.
Electronic Punk wrote on Sazar's profile.
Rest in peace my friend, been trying to find you and finally did in the worst way imaginable.

Forum statistics

Threads
62,015
Messages
673,494
Members
5,621
Latest member
naeemsafi
Back