Search This Blog

Showing posts with label free. Show all posts
Showing posts with label free. Show all posts

Sunday, 23 June 2013

Free Program - Parse filename into components - WDDirSplit

This may be of interest for bat file programmers out there. This simple command-line tool can be used to split a path ("C:\Some\Path\To\Split\File.txt") into its separate components.

Usage

"C:\Bin\WDDirSplit.exe" "C:\Some\Path\To\Split\file.txt" "C:\temp\uniquefilename.bat"
Call "C:\temp\uniquefilename.bat"
Del "C:\temp\uniquefilename.bat"

The above command will write batch SET statements for all path components to "C:\temp\uniquefilename.bat". Please note that the bat file (2nd parameter) will be overwritten if it already exists.

Output

The contents of the generated bat file for the above command is:

rem How many components were found in path "C:\Some\Path\To\Split\file.txt"
SET WD_DP_COUNT=5
rem WD_DP_1 has the first component ("Some"), WD_DP_2 the second...
SET WD_DP_1=Some
SET WD_DP_2=Path
SET WD_DP_3=To
SET WD_DP_4=Split
SET WD_DP_5=file.txt
rem WD_DPR_1 has the last component ("file.txt"), WD_DPR_2 the one before it..(R=Reversed)
SET WD_DPR_1=file.txt
SET WD_DPR_2=Split
SET WD_DPR_3=To
SET WD_DPR_4=Path
SET WD_DPR_5=Some
rem For conveniance: WD_DP_FIRST and WD_DP_LAST
SET WD_DP_FIRST=Some
SET WD_DP_LAST=file.txt

Download

Download WDDirSplit here (~100kb)

Saturday, 4 May 2013

Free Program - SlowCopy

For those people who think their computer and network is too fast, here is a little commandline program to slowly copy a file. You typically use it to prevent hogging the network performance when copying large and/or many files.

By default it works by inserting short delays (a few milliseconds) after reading/writing a chunk of the file. Download it here.

SlowCopy [-i 0] [-b 16384] [-p 5] [-e 0] [-o[n]] source-file target-file
-i seconds
   Before doing anything, sleep this many seconds. Defaults to 0 (zero).
-b bytes
   Read/Write files this many bytes at a time. Defaults to 16384 bytes.
-p milliseconds
   Pause this many milliseconds after each write. Defaults to 5 milliseconds.
-e seconds
   Pause this many seconds after the file is copied. Defaults to 0 (zero).
-o
   Will overwrite the target-file if it exists (otherwise aborts).
-on
   Will overwrite the target-file if it exists only if source is newer.
source-file
   The file to copy.
target-file
   The new file to create. Directories are created as needed.

If SlowCopy is called using WatchDirectory you can use {Dynamic Naming} for the
target file http://www.watchdirectory.net/wdhelp/plugins/dynamicname_functions.html