Page 1 of 1 1
Topic Options
#42902 - 2003-07-16 02:58 PM Software Inventory for Windows 98
Thanatos Offline
Fresh Scripter

Registered: 2003-07-16
Posts: 6
Loc: Germany
Hi,

i have a working script for my software inventory with Windows NT/2k but it doesn't work with 98 / ME. Can anyone help me and post a script for these OS that works ???
That would be very helpful. Thanks

Top
#42903 - 2003-07-16 03:02 PM Re: Software Inventory for Windows 98
Jochen Administrator Offline
KiX Supporter
*****

Registered: 2000-03-17
Posts: 6345
Loc: Stuttgart, Germany
Uh ...

Welcome [Smile]

There might be different Locations to dig for Inventory data in Wintendo.

The easier way would be to show us what you have and get some cosmetics regarding OS selection
_________________________



Top
#42904 - 2003-07-16 03:05 PM Re: Software Inventory for Windows 98
Thanatos Offline
Fresh Scripter

Registered: 2003-07-16
Posts: 6
Loc: Germany
Thanks for Welcome [Smile]

Ok here it goes:

code:
BREAK ON
flushkb
cls
$RC=0
$line=""
$logfile=""
$runfile=""
$inifile=""
$Logfile="LOG.TXT"
$Errorfile="Error.txt"
$Errorfile2="Error2.txt"
$RechnerFile="Rechner.ini"
$LogFileEng="\\" + $Rechner + "\c$\winnt\config\Wks40e.txt"

Open( 3 , $Logfile , 5 )

IF EXIST ($Errorfile)

$inifile = $Errorfile
Open( 4 , $Errorfile2 , 5 )

else

$inifile=$RechnerFile
Open( 4 , $Errorfile , 5 )

ENDIF

if open(1,$inifile) = 0

flushkb

$line = readline(1)

WHILE @error = 0

$Rechner = substr ($line,1,8)

$debug_mode = "no"

$obj = GetObject("WinNT://" + $Rechner + ",computer")

? "Bin jetzt bei Rechner: " + $Rechner

IF @error <> 0

$x = WriteLine( 4 , $Rechner + ";" + @serror + ";" + @DATE + " " + @TIME + @CRLF )

ELSE

$ikey="\\" + $Rechner + "\HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion\Uninstall"
$ikey3="\\" + $Rechner + "\HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion"

IF (existkey($ikey) = 0)
$completed="no"
$index=0
DO
$icode=ENUMKEY($ikey, $index)
IF (@error = 0)
IF ($debug_mode = "yes")
? $ikey+"\"+$icode
ENDIF
IF (len($icode) <> 0)
$ikey1=$ikey+"\"+$icode
IF (existkey($ikey1) = 0)
$completed1="no"

$index1=0

DO
$icode1=ENUMVALUE($ikey1, $index1)
IF (@error = 0)
IF ($debug_mode = "yes")
? $icode1
ENDIF

IF ($icode1) = "DisplayName"

$Rows1=0
$Rows2=0
$Rows3=0
$Rows4=0
$Rows5=0
$Rows6=0
$Rows7=0
$Rows8=0

$Rows1 = ReadValue($ikey1, "DisplayName")
$Rows2 = ReadValue($ikey1, "DisplayVersion")
$Rows3 = ReadValue($ikey3, "ProductName")
$Rows4 = ReadValue($ikey3, "CurrentVersion")
$Rows5 = ReadValue($ikey3, "CurrentBuildNumber")
$Rows8 = ReadValue($ikey3, "CSDVersion")

if $Rows4 = "4.0"
$Rows3 = "Windows NT"
endif

$LogFileEng="\\" + $Rechner + "\c$\winnt\config\Wks40e.txt"

if EXIST ($LogFileEng)

$Rows7 = "english"
else
$Rows7 = "deutsch"
endif

;$Rows6 = $Rows3 + "/ Version: " + $Rows4 + "/ Build: " + $Rows5

$x = WriteLine( 3 , $Rechner + ";" + $Rows1 + ";" + $Rows2 + ";" + $Rows3 + ";" + $Rows4 + ";" + $Rows5 + ";" + $Rows7 + ";" + $Rows8 + ";" + @DATE + @TIME + @CRLF )

ENDIF

ELSE
$completed1="yes"
ENDIF
$index1=$index1+1
UNTIL ($completed1 = "yes")
$x=$x+")"
ENDIF
ENDIF
ELSE
$completed="yes"
ENDIF
$index=$index+1
UNTIL ($completed = "yes")
ENDIF
ENDIF

:nextline
$line = readline(1)
LOOP

$RC = close (1)

else

? "Error opening the File."

ENDIF




Top
#42905 - 2003-07-16 03:23 PM Re: Software Inventory for Windows 98
Howard Bullock Offline
KiX Supporter
*****

Registered: 2000-09-15
Posts: 5809
Loc: Harrisburg, PA USA
I think this may have something to do with the Win9x failures.


$obj = GetObject("WinNT://" + $Rechner + ",computer")
? "Bin jetzt bei Rechner: " + $Rechner

IF @error <> 0
$x = WriteLine( 4 , $Rechner + ";" + @serror + ";" + @DATE + " " + @TIME + @CRLF )
ELSE
$ikey="\\" + $Rechner + "\HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion\Uninstall"
$ikey3="\\" + $Rechner + "\HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion"


Do you have ADSI installed on the Win9x computers?

Are you getting the error text listed above? If so, your WinNT:// provider GetObject is failing.

If I am barking up the wrong tree let me know.
_________________________
Home page: http://www.kixhelp.com/hb/

Top
#42906 - 2003-07-16 03:35 PM Re: Software Inventory for Windows 98
Thanatos Offline
Fresh Scripter

Registered: 2003-07-16
Posts: 6
Loc: Germany
yes, i get this error message.

The Installation on the Win98 Systems are Basic Installation, or better may be Basic..
Therefore ADSI isn't installed.

I have to check a few computers in a company for the installed software and wanted to do this via remote connection.

Top
#42907 - 2003-07-16 03:40 PM Re: Software Inventory for Windows 98
Howard Bullock Offline
KiX Supporter
*****

Registered: 2000-09-15
Posts: 5809
Loc: Harrisburg, PA USA
You can not use ADSI (WinNT://) if it is not installed. I don't even know if you can use WinNT:// with Win9x. You also can not connect to a Win9x remote registry if you did not install and activate Win9x remote registry service (I think that is the correct name).

[ 16. July 2003, 15:42: Message edited by: Howard Bullock ]
_________________________
Home page: http://www.kixhelp.com/hb/

Top
#42908 - 2003-07-16 03:45 PM Re: Software Inventory for Windows 98
Thanatos Offline
Fresh Scripter

Registered: 2003-07-16
Posts: 6
Loc: Germany
And how about to run this script locally, how can i get a list of the software that is installed ?

I tried that script in rewritten so that it runs locally but i don't know what to use instead of WinNT://

Top
#42909 - 2003-07-16 03:49 PM Re: Software Inventory for Windows 98
Sealeopard Offline
KiX Master
*****

Registered: 2001-04-25
Posts: 11162
Loc: Boston, MA, USA
There are actually even morte problems. There's a reference to c$ with regards ot the logfile which will require administrative privileges.

The .INI file is being read via READLINE even though .INI ifles have a special formatting so that they shoudl only be used in conjunctions with READPROFILESTRING/WRITEPROFILESTRING.

Remote registry access will not work under Windows 9x unless it has been installed manually. This requires changes tot he network setup, installation of the remote registry service and other configurations

Additionally, ADSI and WMI will need to installed mnuallyt and need to be configured manually to allow remote administrative access.

Finally, the whole script is written without any concern for Windows 9x computers at all and will even create problems under Windows NT/2000/XP/2003 computers due to potential differences in the %SYSTEMROOT% directories and potentially disabled administrative shares.
_________________________
There are two types of vessels, submarines and targets.

Top
#42910 - 2003-07-16 04:05 PM Re: Software Inventory for Windows 98
Thanatos Offline
Fresh Scripter

Registered: 2003-07-16
Posts: 6
Loc: Germany
I know about the problems that you mentioned. Thats why i asked for a solution to run a script locally , but with windows 98 / me
Top
#42911 - 2003-07-16 04:11 PM Re: Software Inventory for Windows 98
Jochen Administrator Offline
KiX Supporter
*****

Registered: 2000-03-17
Posts: 6345
Loc: Stuttgart, Germany
That should be no problem at all, I mean running a script locally on Windows 9x Computers...

Can't provide a ready-to-use Solution as I lack of 9x Computers, sorry.
_________________________



Top
#42912 - 2003-07-16 04:26 PM Re: Software Inventory for Windows 98
Sealeopard Offline
KiX Master
*****

Registered: 2001-04-25
Posts: 11162
Loc: Boston, MA, USA
The whole script will need a complete re-write in order to run it locally. You should also write it in such a way that it will be OS-agnostic and run locally under any Windows OS. Make use of the build-in macros to differentiate between different OSes.
_________________________
There are two types of vessels, submarines and targets.

Top
#42913 - 2003-07-16 05:11 PM Re: Software Inventory for Windows 98
NTDOC Administrator Offline
Administrator
*****

Registered: 2000-07-28
Posts: 11559
Loc: CA
Should work on 9x. Requires KiXtart 4.12 or newer I think.

http://www.kixtart.org/board/ultimatebb.php?ubb=get_topic;f=2;t=003989

Top
#42914 - 2003-07-16 10:07 PM Re: Software Inventory for Windows 98
Lonkero Administrator Offline
KiX Master Guru
*****

Registered: 2001-06-05
Posts: 22303
Loc: OK
getfileversions and all [Big Grin]

actually, thanatos...
reading your code, all you need to make it work locally is to remove all the references to remote.
like:
code:
$ikey="\\" + $Rechner + "\HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion\Uninstall"

translates to:
code:
$ikey="HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion\Uninstall"

what comes to that ADSI provider you get object...
as far as I saw, you never even use it.

so you can fully skip it!
basically your script did work with minor adjustments.
but as you see there are more complex scripts to accomplish better results.
also, good example.
your windows version from reg.
we get it in kixtart with macros like @producttype, @produtsuite, @inwin and @dos.
_________________________
!

download KiXnet

Top
#42915 - 2003-07-19 12:13 AM Re: Software Inventory for Windows 98
Thanatos Offline
Fresh Scripter

Registered: 2003-07-16
Posts: 6
Loc: Germany
Got it !

Thanks for support !

Top
Page 1 of 1 1


Moderator:  Jochen, Allen, Radimus, Glenn Barnas, ShaneEP, Arend_, Mart 
Hop to:
Shout Box

Who's Online
1 registered (KevinOfOz) and 155 anonymous users online.
Newest Members
phanhuyen345, msmile032, bellamabel2018, lmnopq098068, nathanjame
17561 Registered Users

Generated in 0.035 seconds in which 0.011 seconds were spent on a total of 12 queries. Zlib compression enabled.

Search the board with:
superb Board Search
or try with google:
Google
Web kixtart.org