Need to write a program

  • Thread starter Thread starter skissh
  • Start date Start date
S

skissh

I would like to write a program that would check the size of a specific
folder once a day. When that folder got to a certain size, the program
would put a message on the desktop. How is this done simply. Do I need
to learn some computer language, buy .NET, download Java or can I just
do something at the "command prompt" whatever that is. Can anyone
direct me? I have programmed in Visual C++, but I don't know how to do
anything without that platfrom. Thanks.
 
I would like to write a program that would check the size of a specific
folder once a day. When that folder got to a certain size, the program
would put a message on the desktop. How is this done simply. Do I need
to learn some computer language, buy .NET, download Java or can I just
do something at the "command prompt" whatever that is. Can anyone
direct me? I have programmed in Visual C++, but I don't know how to do
anything without that platfrom. Thanks.

You could have Task Scheduler run the following batch file once a day:

==========begin file c:\cmd\demo\WSHDirSizeMessage.cmd ==========
01. @echo off
02. setlocal enabledelayedexpansion
03. set limit=16000000
04. for /f "tokens=3" %%a in (
05. 'dir /w /-c %temp% ^| find " File(s) "'
06. ) do set /a dirsize=%%a
07. if %dirsize% leq %limit% goto :EOF
08. echo>%temp%\WSHDirSizeMessage.vbs Result = MsgBox("Directory %temp%
size of %dirsize% exceeds the limit of %limit%.", 0, "Dir Size Message")
09. cscript //nologo c:\temp\WSHDirSizeMessage.vbs
==========end file c:\cmd\demo\WSHDirSizeMessage.cmd ==========

(Watch out for line wrap!)
 
Thanks for the code. I have some questions. I hope your still willing
to help.
1. What is the expression in your code that I replace with the actual
folder name and path I'm interested in?
2. Are there any other changes I need to make?
3. What kind of code is this? I would to learn more about it.
4. Do I need to store it any place in particular or just let the
scheduler know where it is?
 
Thanks for the code. I have some questions. I hope your still willing
to help.

Sure. It would have been nice if you had included (quoted) my reply to
your original post in this message so that I didn't have to go look for
it.
1. What is the expression in your code that I replace with the actual
folder name and path I'm interested in?
%temp%

2. Are there any other changes I need to make?

You decide.
3. What kind of code is this? I would to learn more about it.

It's a batch file that dynamically creates and then invokes a one-line
Windows Scripting Host script.
4. Do I need to store it any place in particular or just let the
scheduler know where it is?

If you are going to have the scheduler run it, then I guess you will
have to store it in some particular place so that the scheduler knows
where to find it. :-)
 
Back
Top