Select Page

Regular expressions in MS-DOS

If you have a path and filename and you want to extract the filename from the path then you can use the following regex: %~NXf e.g. for %f in (c:\temp*.pdf) do copy %f c:\pdffiles\%~nxf This will append only the filename to the final path. This is a bit of a...

A Handy Hint for DOS

for /R %z in (*.zip) do unzip “%z” The DOS for command can simplify a lot. The above example will iterate over a file (you can specify delimeters & variables) and carry out an opertion of each item found. One I use a lot is; for %f in (.dll,.ocx) do...
%d bloggers like this: