Page 1 of 1 1
Topic Options
#15672 - 2002-01-03 10:07 PM GetFolderSize Unknown command...
Anonymous
Unregistered


Hey all,

I have a script checking folder size before backup. It works on all but one machine. It's WIN98se and we have several others that run the same just fine.

The code is right of the UDFs and stops with the error below.

Unknown command
$fold = $fso.getfolder($path)

Here's the section of the script:

:GDAY
function GetFolderSize($path)
DIM $fso, $fold
$GetFolderSize = -3
if exist($path) = 1
$FSO = createobject("scripting.filesystemobject")
$fold = $fso.getfolder($path)
$GetFolderSize = $fold.size
exit(0)
else
exit(3)
endif
endfunction

$result = GetFolderSize("c:\mydocu~1")
If $result > "200000000"
$Selection = Messagebox(" Your 'My Documents' folder is too large for backup. Please see the network administrator.", "Notice", 0)
Exit
Endif


Parden the pasting but the code should be errelevant as it works on so many other pcs.

Thanks

Top
#15673 - 2002-01-03 11:00 PM Re: GetFolderSize Unknown command...
Shawn Administrator Offline
Administrator
*****

Registered: 1999-08-13
Posts: 8611
hey kix me !

This one machine - does it *not* have office installed ?

-Shawn

Top
#15674 - 2002-01-03 11:13 PM Re: GetFolderSize Unknown command...
Anonymous
Unregistered


It has O2K with variuos patches.
Top
#15675 - 2002-01-04 12:06 AM Re: GetFolderSize Unknown command...
Shawn Administrator Offline
Administrator
*****

Registered: 1999-08-13
Posts: 8611
Does this key exist ?

HKEY_CLASSES_ROOT\Scripting.FileSystemObject

-Shawn

Top
#15676 - 2002-01-04 12:18 AM Re: GetFolderSize Unknown command...
Anonymous
Unregistered


Noooo it doesn't. Is this another patch feature?
Top
#15677 - 2002-01-04 12:28 AM Re: GetFolderSize Unknown command...
Alex.H Offline
Seasoned Scripter

Registered: 2001-04-10
Posts: 406
Loc: France
Just Windows Scripting Host that is not installed or incomplete.
scripting.filesystemobject is a component of WSH. If it's not installed, next commands won't work. Add this :
? ""+@serror
just after createobject("scripting.filesystemobject")

To resolve this, you should check the IE 5.x intall, as the WSH components are installed with it, and maybe they are missing or incomplete

_________________________
? getobject(Kixtart.org.Signature)

Top
#15678 - 2002-01-04 12:30 AM Re: GetFolderSize Unknown command...
Shawn Administrator Offline
Administrator
*****

Registered: 1999-08-13
Posts: 8611
It should have came down with an Office 2000 standard installation ... was this machine installed differently or customized in some way ? Here's a quote from MS:

quote:

The Microsoft Scripting Runtime Object Library
When you install the Office 2000 applications, one of the object libraries installed on your system is the Microsoft Scripting Runtime object library. This object library contains objects that are useful from either VBA or script, so it's provided as a separate library.

If your still interested, might want to see if you can dl the scripting runtimes seperately, i'll have a boo as well...

-Shawn

Top
#15679 - 2002-01-04 02:04 PM Re: GetFolderSize Unknown command...
Anonymous
Unregistered


What other problems will I see without WSH? I would like to keep security sensitive programs to a minimum.
Top
#15680 - 2002-01-04 03:13 PM Re: GetFolderSize Unknown command...
Lonkero Administrator Offline
KiX Master Guru
*****

Registered: 2001-06-05
Posts: 22346
Loc: OK
kix-me,
So are you planning to erase the wsh from every machine you have?
'cause this one seemed to be the only one lacking it.
_________________________
!

download KiXnet

Top
#15681 - 2002-01-04 03:20 PM Re: GetFolderSize Unknown command...
Anonymous
Unregistered


There may be others that I haven't setup that are missing it and haven't reported the problem yet. One of the reasons I started using KiXtart is I hoped it would run outside of MS scriptings holes/patches. I guess it's just one more component I'll have to leave on and keep patched.
Top
#15682 - 2002-01-04 04:04 PM Re: GetFolderSize Unknown command...
Bryce Offline
KiX Supporter
*****

Registered: 2000-02-29
Posts: 3167
Loc: Houston TX
you can remove the WSH executable, but leave the COM objects.

I highly suggest leaving the WSH COM objects, they are very useful and now with kix4.x you can use them.

removing the WSH executable will stop any WSH virus.

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 1680 anonymous users online.
Newest Members
Viginette, ManuvdWielNL, Sir_Barrington, batdk82, StuTheCoder
17888 Registered Users

Generated in 1.675 seconds in which 0.024 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