WinBatch Tech Support Home

Database Search

If you can't find the information using the categories below, post a question over in our WinBatch Tech Support Forum.

TechHome

Functions

Can't find the information you are looking for here? Then leave a message over on our WinBatch Tech Support Forum.

DiskSize and Network Shares

Keywords: 	 disksize network shares

Question:

I need to know an easy way of checking disk space used on remote NT server drives.

I might be presented with \\SERVER Name and then either the share Name or just drive letter E:\

The share name is straight forward in you can map a drive and then use Winbatch disk commands.

However, how do I do the same when I have just E:\ or C:\. I assume I need to map a drive but whats the easy way of finding the share name (some of our servers have default shares - E$ and some are replaced with another name).

Is there a command like wntshareinfo that will provide the share name mapped to \\server\C:

or am I on for the long process of listing shares and seeing which ones resource points to C:\ etc.

Would be nice if I could just have a command that would return disk information on a remote server (i.e. a=diskSize(\\server\c: or \\server\sharename)

Answer:

What kind of problems are you having?
	a=DiskSize("\\server\share")
works for me? It also works for mapped drives.

Some version of wntResources2 shoud expose the available share names on a remote computer. If the drive is not shared then you cannot see it. Also the same drive may have more than one share.

Additional items of note:

  1. WinBatch cannot handle integer numbers greater than about 2.1 billion. So it goes to floating point format instead.

  2. The easist way to make it look normal again is to reduce the number to something more manageable.
    dsize=DiskSize("X:")
    if dsize>1000000000
    xdsize=dsize / (1024000)
    xdsize=strcat(xdsize,"GB")
    else
    if dsize>1000000
    xdsize=dsize/1024)
    xdsize=strcat(xdsize,"MB")
    endif
    endif
    
    Message(dsize,xdsize)
    

Article ID:   W14361
Filename:   DiskSize and Network Shares.txt
File Created: 1999:11:03:12:30:40
Last Updated: 1999:11:03:12:30:40