#125047 - 2004-08-16 02:56 PM
Re: Seach machines hardrives for a file between 2800kb and 2900kb
|
Richard H.
Administrator
Registered: 2000-01-24
Posts: 4946
Loc: Leatherhead, Surrey, UK
|
Most common cause is forgetting to avoid the "." and ".." entries (self and parent).
Not in this case though
It could be a memory leak.
Try adding "$shell=0" just before the function exit.
Edited by Richard H. (2004-08-16 03:05 PM)
|
Top
|
|
|
|
#125048 - 2004-08-16 03:12 PM
Re: Seach machines hardrives for a file between 2800kb and 2900kb
|
Peter Fry
Getting the hang of it
Registered: 2001-07-23
Posts: 95
Loc: Bristol UK
|
trying this now will get back to you ASAP
hopefully this will work
thanks for help
|
Top
|
|
|
|
#125050 - 2004-08-16 03:18 PM
Re: Seach machines hardrives for a file between 2800kb and 2900kb
|
Peter Fry
Getting the hang of it
Registered: 2001-07-23
Posts: 95
Loc: Bristol UK
|
the machine i'm working on as 1.5GB of RAM and there is lots free so i can't see it is running out of ram..... well at least i think it isn't
|
Top
|
|
|
|
#125051 - 2004-08-16 03:23 PM
Re: Seach machines hardrives for a file between 2800kb and 2900kb
|
Peter Fry
Getting the hang of it
Registered: 2001-07-23
Posts: 95
Loc: Bristol UK
|
the kix32.exe process got to around 52mb and then crashed with the same message as b4
any more ideas?
i had over 1200mb of memory free at this point as well
|
Top
|
|
|
|
#125053 - 2004-08-16 03:34 PM
Re: Seach machines hardrives for a file between 2800kb and 2900kb
|
Peter Fry
Getting the hang of it
Registered: 2001-07-23
Posts: 95
Loc: Bristol UK
|
kix32.exe version 4.22
|
Top
|
|
|
|
#125054 - 2004-08-16 03:39 PM
Re: Seach machines hardrives for a file between 2800kb and 2900kb
|
Richard H.
Administrator
Registered: 2000-01-24
Posts: 4946
Loc: Leatherhead, Surrey, UK
|
Try this:
Code:
Break ON
$=SetOption("WrapAtEOL","ON")
Global $iRecursiveDepth
Global $oShell
$oShell=createobject("shell.application")
drivescan("\\CLIENTPC\c$")
"Done." ?
Function drivescan($sPath)
Dim $oItem
For Each $oItem in $oShell.namespace($sPath).items
If $oItem.isfolder
$iRecursiveDepth=$iRecursiveDepth+1
"New recursion <"+$iRecursiveDepth+"> "+$oItem.path ?
drivescan($oItem.path)
$iRecursiveDepth=$iRecursiveDepth-1
EndIf
Next
Exit 0
EndFunction
|
Top
|
|
|
|
#125055 - 2004-08-16 03:45 PM
Re: Seach machines hardrives for a file between 2800kb and 2900kb
|
Peter Fry
Getting the hang of it
Registered: 2001-07-23
Posts: 95
Loc: Bristol UK
|
where would i add the filesize required in this new script?
|
Top
|
|
|
|
#125057 - 2004-08-16 03:49 PM
Re: Seach machines hardrives for a file between 2800kb and 2900kb
|
Peter Fry
Getting the hang of it
Registered: 2001-07-23
Posts: 95
Loc: Bristol UK
|
k i'm running it now
thanks for all this help!
|
Top
|
|
|
|
#125058 - 2004-08-16 03:53 PM
Re: Seach machines hardrives for a file between 2800kb and 2900kb
|
Richard H.
Administrator
Registered: 2000-01-24
Posts: 4946
Loc: Leatherhead, Surrey, UK
|
The script is a "debug" version, to try and get a handle on how and why you are getting the exception.
You need to ensure it runs through to completion before you start to worry about adding other features.
Something like this will do you however: Code:
Break ON $=SetOption("WrapAtEOL","ON") Global $iRecursiveDepth Global $oShell $oShell=createobject("shell.application") drivescan("\\SGB007968\c$") "Done." ? Function drivescan($sPath) Dim $oItem For Each $oItem in $oShell.namespace($sPath).items If $oItem.isfolder $iRecursiveDepth=$iRecursiveDepth+1 "New recusion <"+$iRecursiveDepth+"> "+$oItem.path ? drivescan($oItem.path) $iRecursiveDepth=$iRecursiveDepth-1 Else If 2799<$oItem.size AND 2901>$oItem.size "*** File match "+$oItem.size+" "+$oItem.path ? EndIf EndIf Next Exit 0 EndFunction
|
Top
|
|
|
|
#125059 - 2004-08-16 03:56 PM
Re: Seach machines hardrives for a file between 2800kb and 2900kb
|
Peter Fry
Getting the hang of it
Registered: 2001-07-23
Posts: 95
Loc: Bristol UK
|
ok running code - i did it wrong first time i'll let you know what happens
|
Top
|
|
|
|
#125060 - 2004-08-16 04:10 PM
Re: Seach machines hardrives for a file between 2800kb and 2900kb
|
Peter Fry
Getting the hang of it
Registered: 2001-07-23
Posts: 95
Loc: Bristol UK
|
New recursion <1111> \\Homesrv\aam1402$\old profile\Application Data\Microsoft\Office\Shortcut Bar\Office
thats the last line in the list
|
Top
|
|
|
|
#125064 - 2004-08-17 09:34 AM
Re: Seach machines hardrives for a file between 2800kb and 2900kb
|
Peter Fry
Getting the hang of it
Registered: 2001-07-23
Posts: 95
Loc: Bristol UK
|
ok i think i've sorted out that problem
it had found a "nethood" directory with loads of shortcuts in
for a quick fix i removed this directory (it was nothing important)
now to see what happens next
thanks for all the help so far !!
|
Top
|
|
|
|
#125065 - 2004-08-17 09:59 AM
Re: Seach machines hardrives for a file between 2800kb and 2900kb
|
Peter Fry
Getting the hang of it
Registered: 2001-07-23
Posts: 95
Loc: Bristol UK
|
ok i've found the problem
how can i get it so if the script finds a folder called "NetHood" it doesn't go down and look in this folder?
Pete
|
Top
|
|
|
|
#125066 - 2004-08-17 11:10 AM
Re: Seach machines hardrives for a file between 2800kb and 2900kb
|
Richard H.
Administrator
Registered: 2000-01-24
Posts: 4946
Loc: Leatherhead, Surrey, UK
|
Simplest is probably to change this line: Code:
If $oItem.isfolder
to read: Code:
If $oItem.isfolder AND Not InStr($oItem.path,"Nethood")
NB, if shortcuts are the problem you may well find them in other folders, so you may want to consider finding a smarter method.
|
Top
|
|
|
|
Moderator: Jochen, Allen, Radimus, Glenn Barnas, ShaneEP, Ruud van Velsen, Arend_, Mart
|
0 registered
and 259 anonymous users online.
|
|
|