Solved

DOS commands to find out Hard drive used/free space on remote server

Posted on 2004-08-06
6
2,141 Views
Last Modified: 2012-05-05
i need a DOS command that i can put in a batch file that will show how much hard drive space/used/free is on a remote server. i do not want a thirdparty tool or VB script.
0
Comment
Question by:xxgenius
6 Comments
 
LVL 5

Accepted Solution

by:
Big5250 earned 250 total points
ID: 11738636
srvinfo.exe from the resource kit

hth
0
 
LVL 16

Expert Comment

by:robrandon
ID: 11738643
There is a pearl script on the Windows Resource Kit that you may be able to call from your DOS batch file.  It is called diskusage.pl.  I'm not sure how you would work with the output in your batch file.  This is an excerpt from the help file:


Example 2: Display Information About Remote Folders
The following command displays information about several folders on a remote computer, SERVER01. It uses the -s parameter to identify the computer, and the -u and -p parameters to run the script tool in a security context that has the required permissions.

diskusage.pl c:\art c:\schedules c:\documents -s SERVER01 -u RESKIT\Administrator -p 43232#!DSFD

In response, Diskusage.pl displays the following information about the folders. The Path\File field shows the location of each object.


  Size(KB)    Compressed Type     Total Files Path\File
------------- ---------- ---------- ----------- -----------------
     3.384766   Yes        File       N/A     c:\art\arrow.gif
     3.384766   Yes        File       N/A     c:\art\banner.gif
          N/A   Yes        Directory  2       c:\art\current
          N/A   Yes        Directory  1       c:\art\new files
     0.022344   No         File       N/A     c:\schedules\event_i.txt
10,458.670000   No         File       N/A     c:\schedules\thurs.mov
     6.884340   No         File       N/A     c:\docs\about.htm
     1.480000   No         File       N/A     c:\docs\props.csv
          N/A   No         Directory  7       c:\docs\renew


--------------------------------------------------------------------------------
0
 
LVL 16

Expert Comment

by:robrandon
ID: 11738651
Looks like srvinfo.exe works much better....
0
Free Webinar: AWS Backup & DR

Join our upcoming webinar with experts from AWS, CloudBerry Lab, and the Town of Edgartown IT to discuss best practices for simplifying online backup management and cutting costs.

 
LVL 14

Expert Comment

by:dlwyatt82
ID: 11738821
I don't know if you consider resource kit utilities as "Third Party". If you don't want to use srvinfo or any of the other scripts / tools available in the resource kit, you can get the Free space of a drive simply by using the Dir command, something like this:

net use z: \\Server\c$ > nul 2>&1
dir z: | findstr /i /C:"bytes free"
net use z: /delete > nul 2>&1
0
 
LVL 5

Expert Comment

by:LordRipper
ID: 11742663
well the easyiest way to do it is just to share the hardrive on the server ..... then map it on your computer as another drive ..... lets say drive F
then creat a batch file and paste the following into it

echo For you by LordRipper  .....
Echo Please wait this may take a phew minutes
CHKDSK F: /I /C
pause

this will do a disk scanning almost like a scandisk ...... but afterwords it'll show you free/used space on the server
goodluck
0
 
LVL 8

Author Comment

by:xxgenius
ID: 11752330
i liked all the ideas, but i'm going to go with Big5250.  this is the easiest since it does not need to be installed on the server or pc(just needs the file).  since it is from MS resource kit, it can be trusted, unlike freeware or VB scripts written by other people.  it gives a bit more then needed, but it does include what i need.  i didn't want to create shares to the server that needs to be monitored.  i don't want the users who require this info to have their hands on this server.
0

Featured Post

U.S. Department of Agriculture and Acronis Access

With the new era of mobile computing, smartphones and tablets, wireless communications and cloud services, the USDA sought to take advantage of a mobilized workforce and the blurring lines between personal and corporate computing resources.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

NTFS file system has been developed by Microsoft that is widely used by Windows NT operating system and its advanced versions. It is the mostly used over FAT file system as it provides superior features like reliability, security, storage, efficienc…
Azure Functions is a solution for easily running small pieces of code, or "functions," in the cloud. This article shows how to create one of these functions to write directly to Azure Table Storage.
Although Jacob Bernoulli (1654-1705) has been credited as the creator of "Binomial Distribution Table", Gottfried Leibniz (1646-1716) did his dissertation on the subject in 1666; Leibniz you may recall is the co-inventor of "Calculus" and beat Isaac…

679 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question