|
|
|||||||||
|
|||||||||
|
|||||||||
| |
||
| ||||||||||||||||||||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
#1
|
|||
|
|||
|
DOS Batch - Script to clean directory on a regular basis
Good morning, I am VERY VERY new to the scripting world, and hope to learn from this site. I have a server that is utilized as a desktop authority server, it has a directory
C:\Program Files\ScriptLogic\OpsMasterService\ETLFileReposito ry This directory gets filled up very quickly with tens of thousands of logs. I need to know if I can create a script to do this. Usually I go to the command prompt and do the following...Change the directory to this, then when I get to it, I use the following command... del *.* /s I would like to know if there is a better automated way to do this. Thank you, Bryan |
|
#2
|
||||
|
||||
|
Well, the easiest way is probably to create a batch file with the two lines you have already. Name it whatever you like and make sure it has a .bat extension.
Code:
cd "C:\Program Files\ScriptLogic\OpsMasterService\ETLFileReposito ry" del *.* /s
__________________
Scripting problems? Windows questions? Ask the Windows Guru! Stay up to date with all of my latest content. Follow me on Twitter! Help us help you! Post your exact error message with these easy tips! |
|
#3
|
|||
|
|||
|
Quote:
This is what I ended up doing, but the problem is that I get a prompt asking me if I am sure, and I tried to use the /y switch, and it does not work. I need to automate that yes answer too. |
|
#4
|
||||
|
||||
|
Quote:
Code:
cd "C:\Program Files\ScriptLogic\OpsMasterService\ETLFileReposito ry" del *.* /s /q |
|
#5
|
|||
|
|||
|
Quote:
Looks good... Thank you. |
|
#6
|
||||
|
||||
|
Quote:
|
![]() |
| Viewing: ASP Free Forums > System Administration > Windows Scripting > DOS Batch - Script to clean directory on a regular basis |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|
|