With is a Windows console command that lets you do things with all or some files in a directory.
Current version: 2018-03-26 – download link below.
with [options] filename [do] command line
Executes 'command line' for all files matching 'filename' in the current directory
'filename' is meant to contain wildcard characters ? or *, * can stand for *.*
with -? displays the help text
'do' can be written after 'filename' but has currently no function
-q -- quiet, don't display commands
-n -- display number of files at the end
-t -- test only, don't execute
-° -- do NOT substitute ° with space character
-² -- do NOT substitute ² with "
'Command line' can contain the following symbols:
*.* stands for the full file name
* can be used instead of *.* when it occurs as a separate word
*. stands for the file name without extension, including the dot
*' stands for the file name without extension, not including the dot
.* stands for file extension, including the dot
'* stands for file extension, not including the dot
Enclose redirection/pipe symbols < > | in " " to make them part of 'command line'
° can be used for spaces in file names, both in 'filename' and 'command line'
² stands for double quotes meant to be included in 'command line'
If you need ° to stand for itself, you have to use the option -° and, if necessary, enclose file names with spaces in " "
If you need ² to stand for itself, you have to use the option -²
renames all files *.jpeg to *.jpg
copies all files *.txt to * backup.txt
deletes those .rw2 files whose corresponding .jpg files have been deleted.
This is actually what made me want to write this tool. My camera writes two files for each picture, .jpg and the "raw" file .rw2
With an image viewer I browse the .jpg files and delete the ones I don't want to keep, which leaves the corresponding .rw2 files to be deleted.
If you mistype the "if" clause, all your .rw2 files may be gone -- this is a safer method:
adds the extension .delete to the files instead of deleting them, you can now check the result and then
Note that * stands for the full file name when it's a separate word, but *.* is needed in the renamed file.
would rename myfile.rw2 to myfile.delete, instead of myfile.rw2.delete
If you want to execute more complex tasks, you can call a .cmd batch file, like:
For a discussion of quotation marks and redirection/pipe symbols, see with.txt
Download and Installation
Download program file and documentation:
with.zip (version 2018-03-26)
Unpack the zip file (it contains with.exe and the documentation file with.txt) and move or copy with.exe to a directory that is included in the system path; you can then use it from the Windows command line. Nothing gets written to the registry. To uninstall, simply delete.
Disclaimer: I have tested this program and am using it myself, but I cannot guarantee its correct function under all circumstances. Use it with caution, and consider backing up your data before executing commands that may involve deleting or overwriting files. Incorrect use can lead to loss of data.
This program, including the source code, is freeware. Do with it whatever you like. If you have any questions, suggestions, complaints or comments, I’d be glad to hear from you.
This program is written in Euphoria, version 4.0.5, compiled with Watcom C/C++ compiler 1.9, and compressed with upx. Euphoria is open source, and available at openeuphoria.org
Download Euphoria source files (not necessary for using the program):
04/04/2018 - documentation updated
03/26/2018 – program and documentation updated, added ² to stand for "
03/21/2018 – first published version