Similar to the above script based on common requests from systemĪdministrators. Itĭeletes files in and below any directory you select based on age.ĭesignated file extensions can be protected from deletion. Let it loose on the network "share" drive every once in a while. Use it likeĬscript.exe TrimLogFiles.vbs "c:\logs\server.log" 32767 Delete Old Max size (between a hundred bytes and a million bytes). Keeps the most recent entries at the end of the log and throws away oldĮntries at the beginning of the log. The log files must have entries on separate lines. I have lots of log files that do nothing but grow. Located and produces a tab-delimited report named after the script file The script starts running in the directory where it is With "Function " or "Sub ", and again, this is easily modified via aĬonstant. As written, it searches VBS and ASP files, but
This will search all your source code and document the functions and Possible to do those things with almost no effort. May have been frustrated by how difficult it is to update, sort, and If you're the sort of person who uses (or misuses) the HOSTS file to It will verify what file extensions you want to modify, andĬonvert all instances of four spaces to a single tab character. Unfortunately, it also made it harder toĮdit under Notepad! So I changed all my scripts to use tabs instead of I used to write all my scripts with spaces for indenting because it This code as a reference when you need to do something like show all This script generates a CSV report showing all the details forĮvery file in a folder. Obviously not all properties apply to allįiles. Like the file version, description, manufacturer, owner, title, audioįormat, and sender name.
Scripting.FileSystemObject, using Shell.Application also gets you data InĪddition to the normal file attributes exposed by the Uses the Shell.Application/Namespace/GetDetailsOf function to retrieveĪll the file details you'd normally get by right-clicking a file. The script has no idea where they would go in the destination tree! If the source tree has extraįiles in it, they won't be copied over to the destination tree because An effect of unstructured tolerance is that only existingįiles in the destination are processed. Note that the source and destination trees do NOT have to have the same If a newer version isĪvailable in the source tree, it copies it to the destination tree. Match, it checks file modification dates. In the source tree (my single folder of unsorted files). Utilities organized by category), then searches for the matching file It looks at every file in every folder in the destination tree (my
Update them, I always put the updates in the flat single-folder tree. Utilities arranged in folders sorted by category.
In my case, I had a "tree" that was a singleįolder full of utility programs. If you have two different folder "trees" you need to synchronize (or The links on this page take you to (very simple) index pages made by Obscure graphics formats to the rescue! For a real-life sample, most of Similar in concept to Fred's script above, except I wanted mine toĭisplay icons. So I gotįred's code posted so YOU won't have to build your solution from Two weeks after I decided nobody would ever need to index aĭirectory, I found myself needing to do it dozens of times.
German PC Magazine! This willl create an "index.htm" file for any givenĭirectory. Fred actually got this one written up in the The file name with year-month-date-hour-minute-second Same as the above DateName, but this one adds time as well. I used year-month-date to make sorting easier. "C:\Program Files\Fnord Web Server\logs\-Reference Log.txt" "C:\Program Files\Fnord Web Server\logs\Reference Log.txt" You pass it aĬscript.exe DateName.vbs C:\PROGRA~1\FNORDW~1\LOGS\REFERE~1.TXTĬscript.exe DateName.vbs "C:\Program Files\Fnord Web Naming them with date seems the most natural solution. Time to allow you to make a few last-minute changes without having toĭo you have a process that kicks out an identically-named file everyĭay? If you want to rename them so they don't overwrite each other,
Numbers on the beginning of the file names. One-at-a-time on this script and it will stick progressively higher Hassle to do manually, so this script was created. Numbers (and a dash) to the beginning of the file names. In order to get my photos to sort right for slide shows, I add
CGI Controls Database Download Encoding Etext File Graphics GUI Miscellaneous Multimedia Run Other Programs Security Serial Speech Upload File Utilities Number File