#119188 - 2004-05-07 01:37 PM
network drive
|
wilcobruxz
Lurker
Registered: 2004-05-07
Posts: 2
|
Hello,
I am making a kix login script, and when users logon the get a P-drive to a user directory on the server (\\server\username$) At the end of the login script there is a messagebox with the username and some other things displayed. Can i show the size of the users P-drive on this messagebox??
|
|
Top
|
|
|
|
#119191 - 2004-05-07 02:10 PM
Re: network drive
|
wilcobruxz
Lurker
Registered: 2004-05-07
Posts: 2
|
Quote:
You can use:
Code:
SHELL "%COMSPEC% /e:1024 /c DIR P:\*.* /s"
Quote:
Total Files Listed: 21175 File(s) 3,827,601,140 bytes
Ik heb deze code toegevoegs aan mijn login script alleen hoe kan ik de uitkomst van de code weergegeven laten worden in mijn messagebox??
|
|
Top
|
|
|
|
#119193 - 2004-05-07 02:19 PM
Re: network drive
|
Richard H.
Administrator
   
Registered: 2000-01-24
Posts: 4946
Loc: Leatherhead, Surrey, UK
|
Quote:
You can use:
Code:
--------------------------------------------------------------------------------
SHELL "%COMSPEC% /e:1024 /c DIR P:\*.* /s"
This is a good quick'n'dirty solution, but it has a couple of drawbacks:
- Depending on the number of files and directories, this can take a while to compute
- It won't include the size of the directories themselves (at least I don't think it will - someone correct me if I'm wrong)
- It only counts the size of the data in the file, not the amount of disk used.
That last one may warrant some explanation.
When you create a file with (say) one character in it, the file length is "1".
The actual amount of disk used to store the file however is the size of the basic filesystem block - it used to be 4Kb. This means that your 1 byte file actually uses 4Kb of disk to store it.
These odd fragments of blocks are not particularly interesting for single files, but when you start getting very large numbers of small files the "wasted" space becomes very large.
A good example is temporary Internet files, which by their nature tend to be small and numerous. Here, the discrepancy between the total file size and actual disk space consumed can become significant.
[EDIT]
One notable exception...
Compressed volumes may store the data in a different format, which is slower to access but is far more efficient in terms of disk space usage
[/EDIT]
Edited by Richard H. (2004-05-07 02:28 PM)
|
|
Top
|
|
|
|
#119196 - 2004-05-07 02:38 PM
Re: network drive
|
Chris S.
MM club member
   
Registered: 2002-03-18
Posts: 2368
Loc: Earth
|
How about using fnGetFolderProp()...
Code:
FormatNumber(fnGetFolderProp(@HomeDrive,Size),0)
|
|
Top
|
|
|
|
#119197 - 2004-05-07 03:03 PM
Re: network drive
|
Richard H.
Administrator
   
Registered: 2000-01-24
Posts: 4946
Loc: Leatherhead, Surrey, UK
|
Quote:
How about using fnGetFolderProp()...
Code:
FormatNumber(fnGetFolderProp(@HomeDrive,Size),0)
Close. The size is still the file size in bytes, not disk used.
If you can get the "Size on disk" value that you see when you look at the properties of the file/folder it would be more accurate.
|
|
Top
|
|
|
|
Moderator: Jochen, Allen, Radimus, Glenn Barnas, ShaneEP, Ruud van Velsen, Arend_, Mart
|
0 registered
and 874 anonymous users online.
|
|
|