Script to monitor folder size

Discussion forum for all Windows batch related topics.

Moderator: DosItHelp

Post Reply
Message
Author
masterwix
Posts: 1
Joined: 02 Mar 2016 03:18

Script to monitor folder size

#1 Post by masterwix » 02 Mar 2016 03:30

Hello
i trying to make a script to monitor the size folder every hour and cant :
any help will apreciated.

i need something like this:

script one:
1-chek the actual size of the folder and write the size to a txt file.(in a remote pc like: \\pc2\folder1 )

script two
2-read the file size from the txt and compare with the actual folder size , if size was changed - close the script.
if size not changed open url.

why 2 scripts ? because i want to use the windows schedule,.
thank you very much!

ShadowThief
Expert
Posts: 1166
Joined: 06 Sep 2013 21:28
Location: Virginia, United States

Re: Script to monitor folder size

#2 Post by ShadowThief » 02 Mar 2016 20:46

masterwix wrote:why 2 scripts ? because i want to use the windows schedule.

I'm not entirely sure how those two things are related; you can easily have both of those things in the same script that gets run hourly by the Task Scheduler.

kwsiebert
Posts: 43
Joined: 20 Jan 2016 15:46

Re: Script to monitor folder size

#3 Post by kwsiebert » 03 Mar 2016 08:55

Please provide as many details as possible about the task.

What do you have so far, and what errors are you encountering?

Does the folder you are monitoring contain subfolders that need to be accounted for? Hidden files?

masterwix wrote:in a remote pc like: \\pc2\folder1
As far as I am aware, network paths like that are not usable from the command line. You would need to map the path to a drive letter.

foxidrive
Expert
Posts: 6031
Joined: 10 Feb 2012 02:20

Re: Script to monitor folder size

#4 Post by foxidrive » 03 Mar 2016 22:11

masterwix wrote:\\pc2\folder1
As far as I am aware, network paths like that are not usable from the command line.


Many commands do support that syntax, try the copy or xcopy commands.

kwsiebert
Posts: 43
Joined: 20 Jan 2016 15:46

Re: Script to monitor folder size

#5 Post by kwsiebert » 04 Mar 2016 08:48

foxidrive wrote:Many commands do support that syntax, try the copy or xcopy commands.
Good to know, I never tested them extensively.

Post Reply