View the full version (in russian): Utility to delete files and folders on a mask

Dmitry_4
2005-08-31 12:11:45
It is desirable that rubbed folders subfolders and files, supports exceptions for folders and files, working from the console, laying on the attributes read only.
Can anyone tell me? And I found a few, but they work through the GUI.

Sacrificer
2005-08-31 12:13:00
Dmitry_4
and with parameters del ustaraivaet why not?

Dmitry_4
2005-08-31 12:17:08
Sacrificer , since when t del folders? Yes, and it does not support exceptions.

cannabis
2005-08-31 16:13:47
LiveCD with linux? :) =
And then - as always, is simple and clear :))))): D

Dmitry_4
2005-08-31 16:44:08
Cannabis , your yumar not clear to me.

cannabis
2005-08-31 17:03:41
yumar-niyumar and comrade in a self-made CD with captive-ntfs for this purpose serves. Sorry for offtopic, not anymore :spy:

Dmitry_4
2005-08-31 17:10:47
Damn I need to automate the task. To a scheduler console utility zafigachit with the necessary keys and she would have me daddy clean from unnecessary waste, and need to leave. Maybe in Linux such programmulku there? So, too, would not stop to find out the name.

cannabis
2005-08-31 17:27:31
crontab
man crontab, man rm, less / etc / cron *
Write a script in the crown of his prescribe as necessary, like everything.
What a trash something that need to be cleaned? One folder?

Dmitry_4
2005-08-31 17:31:41
wrote the same kind in Russian that I need. There is a folder in which it is necessary to erase all but a few necessary folders. Ie specify an exception, saying that erase everything except the folder name in which, for example, there are "soft *".

serpet
2005-08-31 17:54:11
Can be small skriptik, like so:

Set fso = CreateObject ("Scripting.FileSystemObject")
For Each hFolder In fso.GetFolder (UsersFolder). SubFolders
If InStr (LCase (hFolder.Name), "soft") Then hFolder.Delete
Next

Dmitry_4
2005-08-31 17:58:46
serpet , it seems to me that it is just these necessary folders and rubs, and leave the rest of the garbage. And if there are any attributes, also will not rub. This is a great script will sculpt that it worked as it should.

MIX
2005-08-31 21:14:35
Quote:

Delete the directory (s) on the mask can be, for example, a script. In Portable Script Center (MS) are two examples: search directory mask and delete directories. Are easy to obtain the desired script. Suppose you want to delete C: \ Temp directory starts all c symbol "T". Then the script might look like this:
Code:

strComputer = "."
Set objWMIService = GetObject("winmgmts:" _
& "{impersonationLevel=impersonate}!\\" & strComputer & "\root\cimv2")

Set colFolders = objWMIService.ExecQuery _
("Select * from Win32_Directory where Name Like '%c:\\Temp\\T%'")

For Each objFolder in colFolders
objFolder.Delete
Next


More complex conditions are realized by appropriate SQL queries, which are outside the scope of the topic.

The script does not pay attention to the attribute «readonly» as subdirectories and files within the directory removed. Checked.

serpet
2005-08-31 22:15:17
Quote:
Seems to me that it is just these necessary folders and rubs, and leave the rest of the garbage. And if there are any attributes, also will not rub. This is a great script will sculpt that it worked as it should.

Well, I, for example scratched. T is really soft in this case ;) Put condition not.
More like there are all sorts of options in methods, such as force and so on.

Dmitry_4
2005-08-31 22:16:30
It's not that.
While found utilitku that can presposobit for that matter - xxcopy.
A little something, but realize through it's real. Another option to transfer files, wrapping in rar archive, with the exception of the mask, and then delete the archive. The only thing in this case confuses this CPU.

NoNone
2005-09-01 09:35:04
Quote:
Only thing in this case confuses this CPU.

You can put zero compression. And I use to automate nnCron, he has his own language (tricky course) or even greater perversion - PHP :)

serpet
2005-09-01 09:50:51
Gygy seem Dmitry principle of languages ‚Äč‚Äčother than batch file ignores ;)

Dmitry_4
2005-09-01 10:20:03
serpet , install php there no one will. Sculpt all crap too. And all this makes the RAR without problems and unnecessary problems, was set up in just 10 minutes.

Propil
2005-09-01 10:47:53
Dmitry_4

FileSync Service did not look for this purpose?

Dmitry_4
2005-09-01 14:23:34
Looked. Not suitable.