Next Question
RSS
Create a simple command line batch file by giving it a .cmd extension, and put a few dir commands in it - 1 per server.
Detailed steps:
Create a new text file on your windows machine (New->Text File)
Double click the file to open and edit it. Enter commands like these (substitute your actual server and folder names):
Dir /A:D \\server1\folderA
dir /A:D \\server2\folderB
Notes:
the switch "/A:D" means only output the directory (the folder, not all the files in the folder).
The folders you want on the servers will have to be accessible by you as shared folders.
You can redirect the output to a file by appending "| filename.txt" to the end of each line or create a second .cmd file that calls the first file and append the above pipe command to it. The vertical line (Shift-\ on most keyboards) is the pipe command output modifier. It redirects output of the dos command.
Permalink | Report
http://curl.haxx.se/docs/manual.html
"curl is a command line tool for transferring files with URL syntax, supporting FTP, FTPS, HTTP, HTTPS, SCP, SFTP, TFTP, TELNET, DICT, LDAP, LDAPS and FILE. curl supports SSL certificates, HTTP POST, HTTP PUT, FTP uploading, HTTP form based upload, proxies, cookies, user+password authentication (Basic, Digest, NTLM, Negotiate, kerberos...), file transfer resume, proxy tunneling and a busload of other useful tricks. "
Permalink | Report
Hope that gets you started, I can provide more detail if you need it.
Source(s):
http://malektips.com/xp_dos_0028.html
http://www.microsoft.com/technet/sysinternals/FileAndDisk/du.mspx
Permalink | Report
Answered Question
M$5
January 20, 2009 06:00 PM
Can you help me create a batch file (or web app) to pull a specific folder size from multiple Windows servers?
This should be really simple to someone that programs or creates batch files. In a given windows domain, I need to run something (batch file, web app on IIS, whatever) that will scan a number of remote boxes (by hostname) and pull back the folder size for one folder on a drive that is present on every server (and has the same letter assignment). I will use whatever technology necessary. It is fine if it just reports it in a command window and writes to .txt or it can run server-side and return results it in a browser window. Any ideas? I did this with WMI calls before but it took me a long time to program it and I have a critical issue.
Interesting Question?
Yes (0)
No (0)
- In Web Development |
- |
- Report |
-
Share
RSS
Best Answer Chosen by Asker
| January 20, 2009 08:03 PM |
Detailed steps:
Create a new text file on your windows machine (New->Text File)
Double click the file to open and edit it. Enter commands like these (substitute your actual server and folder names):
Dir /A:D \\server1\folderA
dir /A:D \\server2\folderB
Notes:
the switch "/A:D" means only output the directory (the folder, not all the files in the folder).
The folders you want on the servers will have to be accessible by you as shared folders.
You can redirect the output to a file by appending "| filename.txt" to the end of each line or create a second .cmd file that calls the first file and append the above pipe command to it. The vertical line (Shift-\ on most keyboards) is the pipe command output modifier. It redirects output of the dos command.
| Asker's Rating: |
• Of the three, this is the one that led me to the best course of action. I copied the app "diruse" to the root of every server (I think a more experienced answer would be "pulling info remotely from batch file takes too long" as I learned) and using psexec to run the app remotely and >> into a .txt
Permalink | Report
Other Answers (2)
January 20, 2009 06:38 PM
I think you can use curl for that. http://curl.haxx.se/docs/manual.html
"curl is a command line tool for transferring files with URL syntax, supporting FTP, FTPS, HTTP, HTTPS, SCP, SFTP, TFTP, TELNET, DICT, LDAP, LDAPS and FILE. curl supports SSL certificates, HTTP POST, HTTP PUT, FTP uploading, HTTP form based upload, proxies, cookies, user+password authentication (Basic, Digest, NTLM, Negotiate, kerberos...), file transfer resume, proxy tunneling and a busload of other useful tricks. "
Permalink | Report
January 20, 2009 08:35 PM
Get hold of the "du" (disk usage) utility for Windows (normally a Unix thing). Once you've got that at your disposal you can point it anyplace that Windows can see, and making a batch file out of it should be as easy as cutting and pasting N lines into a file, one for each share you need to measure. Dump the output into a report file (remembering to use the double >> notation so you append to your file with each new du call), and write the file out to a directory that is visible to IIS. Hope that gets you started, I can provide more detail if you need it.
Source(s):
http://malektips.com/xp_dos_0028.html
http://www.microsoft.com/technet/sysinternals/FileAndDisk/du.mspx
Permalink | Report
Answer this Question
Related Questions
Ask a Question
Buy Mahalo Dollars with Credit Card or PayPal
Top Members
Most Popular Tags
Categories
- Anonymous
- Arts & Design
- Beauty & Style
- Books & Authors
- Business
- Cars & Transportation
- Consumer Electronics
- Coupons Deals
- Education
- Entertainment
- Environment
- Fitness
- Food & Drink
- From Email
- From Iphone
- From Twitter
- Health
- History
- Hobbies
- Home & Garden
- How Tos
- Humor
- Jobs
- Legal
- Local
- Love & Relationships
- Mahalo Answers Community
- Money
- Music
- News
- NSFW
- Parenting
- Pets
- Science & Mathematics
- Services
- Shopping
- Social Science
- Society & Culture
- Sports
- Technology & Internet
- Travel
- Video Games
Welcome New Members
- fb_505831919, December 11, 2009 01:50 AM
- jenniferrosa, December 11, 2009 01:37 AM
- fb_1609042050, December 11, 2009 01:30 AM
- curb193, December 11, 2009 01:30 AM
- bradb2tmo, December 11, 2009 01:29 AM
Mahalo Dollars are the currency of Mahalo Answers.
Each Mahalo Dollar costs $1.
Once you earn more than 40 Mahalo Dollars, you can request to be paid via PayPal. Each Mahalo Dollar is currently worth $0.75 when paid out via PayPal. Learn More