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 advisable to rub the folder with subfolders and files, supported an exception for folders and files to work from the console, put her on the attributes read only.
One can someone tell me? And I found a few, but they work through the GUI.

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

Dmitry_4
2005-08-31 12:17:08
Sacrificer, since when t del folder? 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 I'm not clear.

cannabis
2005-08-31 17:03:41
yumar-niyumar and a comrade-yourself disc with captive-ntfs for such purposes to serve. Sorry for Offtopic, not anymore: spy:

Dmitry_4
2005-08-31 17:10:47
I need to automate the damn problem. In order to scheduler command-line utility with the right key zafigachit and it would be my daddy cleaned of unnecessary garbage, and you should leave. Maybe in Linux is a programmulka? 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 *
You write the script in its crown prescribe how they should, like all.
What a waste, something that has to be cleaned? A folder?

Dmitry_4
2005-08-31 17:31:41
wrote the same kind in Russian that I had. There is a folder in which it is necessary to erase all but the few relevant folders. That is, specify the exception, that they say to wash everything except folders whose name, for example, there is a "soft *".

serpet
2005-08-31 17:54:11
Can a small skriptik, like this:

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 precisely these necessary folders and portrait, and leave the rest of the garbage. And if there are all sorts of attributes, too, will not rub. This is a great script will sculpt to get it to work as it should.

MIX
2005-08-31 21:14:35
[QUOTE =][/QUOTE]
Delete the folder (s) on the mask can be, for example, a script. In the Portable Script Center (MS) are two examples: search the directory by the mask and remove directories. Of these, it is easy to get the desired script. Suppose you want to remove C: \ Temp c all directories starting symbol "T". Then the script could 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 means of 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 being removed. Checked.

serpet
2005-08-31 22:15:17
Quote Dmitry_4:
seems to me that it is precisely these necessary folders and portrait, and leave the rest of the garbage. And if there are all sorts of attributes, too, will not rub. This is a great script will sculpt to get it to work as it should.

Well I, for example, scribbled. Tert really is soft, in this case,) made ??it a condition not.
Another kind is all sorts of options for methods such as force, and so on.

Dmitry_4
2005-08-31 22:16:30
This is all wrong.
While the find utility, which can be presposobit for this business - xxcopy.
A little something, but realized through it's real. Another option to transfer files zapakovka in rar archive, with the exception of the mask, and then delete the archive. The only thing in this case is confusing, since it is the CPU.

NoNone
2005-09-01 09:35:04
Quote Dmitry_4:
The only thing in this case is confusing, since it is the CPU.

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

serpet
2005-09-01 09:50:51
Gygy seem Dmitry on the principle of languages ??other than ignoring the batch file ;)

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

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

FileSync Service was not looking for this purpose?

Dmitry_4
2005-09-01 14:23:34
I looked. Does not fit.