|
|
|||||||||
|
|||||||||
|
|||||||||
| |
||
| ||||||||||||||||||||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
#1
|
|||
|
|||
|
Dear Friends
with kind, i request some one to help me to develop my script.. i have 50 machines in WAN network. all are having same username & different password. example - username: admin password : dt01 , dt02, dt03 etc (note: dt01 is the password for the host dt01 and vice versa..) i have an application running on all those 50 machines. Normally there is a temporary folders getting created in one of the path. example : \\dt01\c$\documents and settings\all users\application data\cvm\logs under the above logs folder the temp folders getting created.i need to delete those frequently.but under the LOGS folder there will be some *.txt files aloso there.i dont want delete this files.becos its required file.. now i am doing it manullay.it takes more time. somebody can pls help me to get a script for this.. |
|
#2
|
||||
|
||||
|
If you use the FileSystemObject's Folder object to attach to the Logs folder on each host, it will provide a Files collection and a Subfolders collection. Deleting the items in the Subfolders collection will remove any folders beneath Logs without removing any files in the Logs folder itself.
__________________
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
|
|||
|
|||
|
ha nilpo
currently i am using the following script.but each host i have to edit the script. how can i alter this script to read multiple hosts form a text file. pls help. Also the below script work properly but not giving any result output. Set fso = CreateObject("Scripting.FileSystemObject") Set oFolder = fso.GetFolder("\\dt01\c$\Documents and Settings\All Users\Application Data\cvm\logs") arrFolders = Array() For Each oFolder In oFolder.SubFolders ' Note : Only use *lowercase* letters in the folder names below: If Not LCase(oFolder.Name) = "foldera" _ And Not LCase(oFolder.Name) = "folderb" _ And Not LCase(oFolder.Name) = "folderc" Then intCount = UBound(arrFolders) + 1 ReDim Preserve arrFolders(intCount) arrFolders(intCount) = oFolder.Path End If Next For n = 0 To UBound(arrFolders) fso.DeleteFolder arrFolders(n), True Next |
![]() |
| Viewing: ASP Free Forums > System Administration > Windows Scripting > WSH - Script required to delete a remote folder's subfolder without deleting the files |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|
|