Page 1 of 1 1
Topic Options
#6902 - 2001-02-15 10:20 AM exist file
Anonymous
Unregistered


Hi,

I remotely want to check if a .ddl exist (in c:\winnt\system32) on about 120 workstations.

I have the following code but it doesn't seem to work:

---------------------------------------------
Break on
CLS

$input = "V:\afdeling\asb\rene\sysybtndll\werkstations.txt"
$output = "V:\afdeling\asb\rene\sysybtndll\dll.txt"

IF OPEN(1,$input,2) = 0
IF OPEN(2,$output,5) = 0
ELSE
?" Error try again"
GOTO END
ENDIF
$Werkstation = ReadLine(1)
WHILE @error = 0
$DLL = EXIST ("\\" + $Werkstation + "\c:\winnt\system32\sysybnt.dll")
IF @error = 0
$nul = WriteLine(2,$Werkstation + chr(13) +chr(10))
ELSE
$nul = WriteLine(2,$Werkstation + "DLL dont exists" +chr(13) +chr(10))
ENDIF
$Werkstation = ReadLine(1)
LOOP
ELSE
?"Werkstations.txt dont exist!"
EXIT
ENDIF
$nul = Close(2)
:END
$nul = Close(1)
EXIT
---------------------------------------------

Can somebody please help me??

Rene

Top
#6903 - 2001-02-15 11:22 AM Re: exist file
Anonymous
Unregistered


Hello Rene..,

The problem is that you should change ' C:\Winnt\.. ' in the line: ' $DLL = EXIST ("\\" + $Werkstation + "\c:\winnt\system32\sysybnt.dll") ' in ' C$\Winnt\.. '

The C$ share is the 'Hidden' C-Drive share..!!

No offence intended., but i took the liberty to rewrite your script..!!

code:

:Start
BREAK ON CLS
IF EXIST("V:\afdeling\asb\rene\sysybtndll\werkstations.txt")=0
AT(02,02)"Werkstations.txt doesn't exist!!"
GOTO End
ENDIF
DEL "V:\afdeling\asb\rene\sysybtndll\dll.txt"
$NULL=OPEN(1,"V:\afdeling\asb\rene\sysybtndll\werkstations.txt")
$NULL=OPEN(2,"V:\afdeling\asb\rene\sysybtndll\dll.txt",5)
$Werkstation=READLINE(1)
WHILE @ERROR=0
AT(02,02)"Checking Workstation : "$Werkstation
IF EXIST("\\" + $Werkstation + "\c$\winnt\system32\sysybnt.dll")
AT(04,02)"File sysybnt.dll : Yes"
$NULL=WRITELINE(2,$Werkstation+",Yes"+CHR(13)+CHR(10))
ELSE
AT(04,02)"File sysybnt.dll : No!"
$NULL=WRITELINE(2,$Werkstation+",No!"+CHR(13)+CHR(10))
ENDIF
$Werkstation=READLINE(1)
LOOP
GOTO End

:End
$NULL=CLOSE(1)
$NULL=CLOSE(2)
EXIT


Succes..!! (good luck)

------------------
To Be Of Service..,
Fabian.
-----------------Paranoia is reality on a finer scale-----------------

[This message has been edited by Fabian (edited 15 February 2001).]

Top
#6904 - 2001-02-16 12:10 AM Re: exist file
Anonymous
Unregistered


Hi Fabian, thanks for the reply.

I tried your script, but when the file exists in "c:\winnt\system32" your script
says it doesn't exists.

Any idea???

Top
#6905 - 2001-02-15 01:12 PM Re: exist file
Anonymous
Unregistered


Hya Rene..,

Maybe i should have told you .. you must be a domain admin to remotely check systems this way..!?

But what does the script do..!?

Top
#6906 - 2001-02-15 01:58 PM Re: exist file
Anonymous
Unregistered


Thanks Fabian, it works.

I had done something like this before with
remotely checking diskspace. I was thought that I didnt need admin privileges.
I should have checked! I've learned my lesson
and want to thank you very much for your help.

Some users where the dll isn't installed
are having problems, so I wanted to check
the 120 workstations for that dll.

If it's not there I'm going to install it.

Top
#6907 - 2001-02-15 02:34 PM Re: exist file
Anonymous
Unregistered


Hya Rene..,

Happy to be of service..!! If you have any questions/remarks just post or email me..!!

Cya..

Top
#6908 - 2001-02-15 05:51 PM Re: exist file
Bryce Offline
KiX Supporter
*****

Registered: 2000-02-29
Posts: 3167
Loc: Houston TX
Rene,

I just happen to have some ready built tools, that are just right for this task that you are trying to do

go here, http://kix.isorg.net/other_scripts/AdminScripts/NT_Admin/ and get the Admin_Connect.kix script.

If you use admin_connect.kix as the frame work for your DLL script, you will just need to write the code that checks for the dll on each $target computer.

Also one of the features of Admin_connect.kix is that it provides a way for you to get around the fact that you are not a Domain Admin on the $target computer.

Bryce

------------------
-------------
kix.isorg.net
-------------

Top
Page 1 of 1 1


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

Who's Online
0 registered and 1821 anonymous users online.
Newest Members
ManuvdWielNL, Sir_Barrington, batdk82, StuTheCoder, M_Moore
17887 Registered Users

Generated in 0.183 seconds in which 0.016 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