PDA

View Full Version : Executables to simplify repetitive actions.


yooniecorn
04-30-2009, 02:31 AM
Do you have any shortcut .bat files, or other executables that you've found or created that help simplify any tedious and repetitive processes that one might do on their computer everyday?

I'm especially interested in any which might help with file-organization.

Paul Komski
04-30-2009, 05:35 AM
In the main .bat files just do what you would type into a command prompt and remember that one .bat file can also call other ones.

I write short executables all the time. The simplest are batch files but other scripts (usually .vbs) are really not that complicated to learn. After that one can write very useful stuff using VBA in MS-Access or as macros in Word and Excel. If you want an executable with a GUI then you could get started, for free, with Visual Basic 2008 Express (http://www.microsoft.com/Express/VB/). If you want other command line run executables then I have recently re-discovered QBasic, which shipped with DOS 6.

There are loads of tutorials on batch files which are worth googling for and it is of course useful to have a good knowledge of DOS commands (http://users.cybercity.dk/~bse26236/batutil/help/INDEX.HTM). Remember too that you can get all the options for a command by suffixing /? after the command. Thus dir /? will give you the options for dir and so on. If you want output to a file and not the console window use > for a new file and >> to append to a new file. The path to the file will be the same location as from where the command was issued unless a full path is specified. Thus dir D: > C:\ddrive.txt should list the contents of D into a new file ddrive.txt created or overwritten in the root of the C: drive.

Copy, Del, XCopy, MD, RD and so on all have their uses for regular simple file and folder manipulations - often augmented by using wild cards. If you have some specifics that you want to be able to automate then let us know.

As an example of other things the following .bat file should do a chkdsk on a couple of drives, output to text then defrag the second drive and shutdown.

chkdsk d: > chklog.txt

chkdsk i: >> chklog.txt

defrag i: -f -v >> chklog.txt

SHUTDOWN -s -t 10

Sylvander
04-30-2009, 05:54 AM
1. Clean out old files with the Windows Janitor script (http://lifehacker.com/software/lifehacker-code/clean-out-old-files-with-the-windows-janitor-script-288443.php).

2. I've suitably edited [really easy] 5 copies of the script, and run those as Windows tasks respectively at 1, 2, 3, 4, 5 minutes past noon every day.
Or else they can be run manually by just double-clicking on each file.

3. They are used to delete the files in certain folders that are older than a certain number of days as follows:
(a) C:\Documents and Settings\[username]\Local Settings\temp [1 day]

(b) C:\Documents and Settings\[username]\Recent [2 days]

(c) C:\WINNT\TEMP [7 days]

(d) C:\WINNT\Minidump [2 days]

(e) D:\Moved\Firefox\Profiles\[name]\minidumps [30 days]