Windows Scripting
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
 
 
User Name:
Password:
Remember me
Go Back   ASP Free ForumsSystem AdministrationWindows Scripting

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread ASP Free Forums Sponsor:
  #1  
Old January 20th, 2007, 10:19 AM
ViRi ViRi is offline
Contributing User
ASP Free Newbie (0 - 499 posts)
 
Join Date: Jan 2006
Posts: 75 ViRi User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 15 h 7 m 43 sec
Reputation Power: 3
Delete Folder Contents Automatically

Hi

I'm running Win XP Pro SP2 and have a security cam recording video to a folder on a daily basis. The obvious problem is that after a few days there is very little disk space left and I need to manually delete the contents of the cam's folder.

I,ve written a simple .bat file to do the delete automatically. See below

Code:
<cam.bat>
@echo off
del/s/q\c:\recorded_Video
exit
<cam.bat>


When I run the file I get no errors but the files within the folder are not deleted.

ViRi

Reply With Quote
  #2  
Old January 21st, 2007, 04:02 PM
noo noo is offline
Registered User
ASP Free Newbie (0 - 499 posts)
 
Join Date: Jan 2007
Posts: 1 noo User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 7 m 36 sec
Reputation Power: 0
Ive got a similar problem. Looking for a script that can delete folders when the free disk space is below x.

Now my recorder store the files in c:\sec\07-01-01 c:\sec\07-01-02 and so on...

Reply With Quote
  #3  
Old January 29th, 2007, 02:41 AM
Shadow Wizard's Avatar
Shadow Wizard Shadow Wizard is offline
Moderator From Beyond
ASP Free God 46th Plane (27500 - 27999 posts)
 
Join Date: Sep 2004
Location: Israel
Posts: 27,635 Shadow Wizard User rank is General 14th Grade (Above 100000 Reputation Level)Shadow Wizard User rank is General 14th Grade (Above 100000 Reputation Level)Shadow Wizard User rank is General 14th Grade (Above 100000 Reputation Level)Shadow Wizard User rank is General 14th Grade (Above 100000 Reputation Level)Shadow Wizard User rank is General 14th Grade (Above 100000 Reputation Level)Shadow Wizard User rank is General 14th Grade (Above 100000 Reputation Level)Shadow Wizard User rank is General 14th Grade (Above 100000 Reputation Level)Shadow Wizard User rank is General 14th Grade (Above 100000 Reputation Level)Shadow Wizard User rank is General 14th Grade (Above 100000 Reputation Level)Shadow Wizard User rank is General 14th Grade (Above 100000 Reputation Level)Shadow Wizard User rank is General 14th Grade (Above 100000 Reputation Level)Shadow Wizard User rank is General 14th Grade (Above 100000 Reputation Level)Shadow Wizard User rank is General 14th Grade (Above 100000 Reputation Level)Shadow Wizard User rank is General 14th Grade (Above 100000 Reputation Level)Shadow Wizard User rank is General 14th Grade (Above 100000 Reputation Level)Shadow Wizard User rank is General 14th Grade (Above 100000 Reputation Level)  Folding Points: 373781 Folding Title: Super Ultimate Folder - Level 1Folding Points: 373781 Folding Title: Super Ultimate Folder - Level 1Folding Points: 373781 Folding Title: Super Ultimate Folder - Level 1Folding Points: 373781 Folding Title: Super Ultimate Folder - Level 1Folding Points: 373781 Folding Title: Super Ultimate Folder - Level 1Folding Points: 373781 Folding Title: Super Ultimate Folder - Level 1
Time spent in forums: 3 Months 2 Weeks 2 h 55 m 37 sec
Reputation Power: 1902
--moved to the Windows Scripting forum.

ViRi, remove the first line from your code.. what is the output?

Reply With Quote
  #4  
Old January 29th, 2007, 08:41 AM
Nilpo's Avatar
Nilpo Nilpo is offline
ASP Free Beginner (1000 - 1499 posts)
 
Join Date: Jun 2006
Location: Salem, OH
Posts: 1,048 Nilpo User rank is Colonel (50000 - 60000 Reputation Level)Nilpo User rank is Colonel (50000 - 60000 Reputation Level)Nilpo User rank is Colonel (50000 - 60000 Reputation Level)Nilpo User rank is Colonel (50000 - 60000 Reputation Level)Nilpo User rank is Colonel (50000 - 60000 Reputation Level)Nilpo User rank is Colonel (50000 - 60000 Reputation Level)Nilpo User rank is Colonel (50000 - 60000 Reputation Level)Nilpo User rank is Colonel (50000 - 60000 Reputation Level)Nilpo User rank is Colonel (50000 - 60000 Reputation Level)Nilpo User rank is Colonel (50000 - 60000 Reputation Level)Nilpo User rank is Colonel (50000 - 60000 Reputation Level)Nilpo User rank is Colonel (50000 - 60000 Reputation Level)  Folding Points: 206875 Folding Title: Super Ultimate Folder - Level 1Folding Points: 206875 Folding Title: Super Ultimate Folder - Level 1Folding Points: 206875 Folding Title: Super Ultimate Folder - Level 1Folding Points: 206875 Folding Title: Super Ultimate Folder - Level 1Folding Points: 206875 Folding Title: Super Ultimate Folder - Level 1Folding Points: 206875 Folding Title: Super Ultimate Folder - Level 1
Time spent in forums: 5 Days 12 h 32 m 33 sec
Reputation Power: 555
Send a message via ICQ to Nilpo Send a message via AIM to Nilpo Send a message via MSN to Nilpo Send a message via Yahoo to Nilpo Send a message via Google Talk to Nilpo Send a message via Skype to Nilpo
MySpace
Put a space between del and /s and between each attribute. Drop the extra \ too. Your script will run, but it will error out on the del command. With echo turned off you won't see this. Unfortunately, even though it doesn't complete the del command, the batch file still returns an error code of 0.

Code:
cam.bat
@echo off
del /s /q c:\recorded_Video\*.*
exit
__________________
Click the image if at any point you don't like my decision.

Scripting problems? Windows questions? Ask the Windows Guru!


Reply With Quote
  #5  
Old January 30th, 2007, 04:42 PM
ViRi ViRi is offline
Contributing User
ASP Free Newbie (0 - 499 posts)
 
Join Date: Jan 2006
Posts: 75 ViRi User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 15 h 7 m 43 sec
Reputation Power: 3
Quote:
Originally Posted by Shadow Wizard
--moved to the Windows Scripting forum.

ViRi, remove the first line from your code.. what is the output?


Hi

I've removed the first line and changed the second line to

del / q c:\recorded_video

and it works fine it will delete all the files it finds in c:\recorded_video

Now I overlooked the fact that my recorded video files are not actually stored in c:\recorded_video but in
c:\Documents and Settings\My Documents\ViRiPuff\recorded_video

I've tried running the same script with the new path and nothing happens no files are deleted

del / q c:\Documents and Settings\My Documents\ViRiPuff\recorded_video

ViRi




<cam.bat>
del / q c:\recorded_Video
exit
<cam.bat>

Reply With Quote
  #6  
Old January 30th, 2007, 10:49 PM
Nilpo's Avatar
Nilpo Nilpo is offline
ASP Free Beginner (1000 - 1499 posts)
 
Join Date: Jun 2006
Location: Salem, OH
Posts: 1,048 Nilpo User rank is Colonel (50000 - 60000 Reputation Level)Nilpo User rank is Colonel (50000 - 60000 Reputation Level)Nilpo User rank is Colonel (50000 - 60000 Reputation Level)Nilpo User rank is Colonel (50000 - 60000 Reputation Level)Nilpo User rank is Colonel (50000 - 60000 Reputation Level)Nilpo User rank is Colonel (50000 - 60000 Reputation Level)Nilpo User rank is Colonel (50000 - 60000 Reputation Level)Nilpo User rank is Colonel (50000 - 60000 Reputation Level)Nilpo User rank is Colonel (50000 - 60000 Reputation Level)Nilpo User rank is Colonel (50000 - 60000 Reputation Level)Nilpo User rank is Colonel (50000 - 60000 Reputation Level)Nilpo User rank is Colonel (50000 - 60000 Reputation Level)  Folding Points: 206875 Folding Title: Super Ultimate Folder - Level 1Folding Points: 206875 Folding Title: Super Ultimate Folder - Level 1Folding Points: 206875 Folding Title: Super Ultimate Folder - Level 1Folding Points: 206875 Folding Title: Super Ultimate Folder - Level 1Folding Points: 206875 Folding Title: Super Ultimate Folder - Level 1Folding Points: 206875 Folding Title: Super Ultimate Folder - Level 1
Time spent in forums: 5 Days 12 h 32 m 33 sec
Reputation Power: 555
Send a message via ICQ to Nilpo Send a message via AIM to Nilpo Send a message via MSN to Nilpo Send a message via Yahoo to Nilpo Send a message via Google Talk to Nilpo Send a message via Skype to Nilpo
MySpace
That's because your file path now contains spaces. You need to enclose it in quotes. And don't forget the *.*

Code:
cam.bat
@echo off
del /q "c:\Documents and Settings\My Documents\ViRiPuff\recorded_video\*.*"
exit

Reply With Quote
Reply

Viewing: ASP Free ForumsSystem AdministrationWindows Scripting > Delete Folder Contents Automatically


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 5 hosted by Hostway
Stay green...Green IT