Solved

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

Posted on 2004-08-06
6
2,109 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
Comment Utility
srvinfo.exe from the resource kit

hth
0
 
LVL 16

Expert Comment

by:robrandon
Comment Utility
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
Comment Utility
Looks like srvinfo.exe works much better....
0
Do You Know the 4 Main Threat Actor Types?

Do you know the main threat actor types? Most attackers fall into one of four categories, each with their own favored tactics, techniques, and procedures.

 
LVL 14

Expert Comment

by:dlwyatt82
Comment Utility
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
Comment Utility
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
Comment Utility
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

How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

Join & Write a Comment

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…
A procedure for exporting installed hotfix details of remote computers using powershell
This video gives you a great overview about bandwidth monitoring with SNMP and WMI with our network monitoring solution PRTG Network Monitor (https://www.paessler.com/prtg). If you're looking for how to monitor bandwidth using netflow or packet s…
This video demonstrates how to create an example email signature rule for a department in a company using CodeTwo Exchange Rules. The signature will be inserted beneath users' latest emails in conversations and will be displayed in users' Sent Items…

743 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

Need Help in Real-Time?

Connect with top rated Experts

17 Experts available now in Live!

Get 1:1 Help Now