A long running story of the interesting things that occupy the attention and thoughts of McCulloch House: Leigh and Donna McCulloch.

Friday, May 22, 2009

How to Create a file of Specified Size

So today for...unimportant reasons, I wanted to create a very large file, in the vicinity of 20Gb, without having to actually do any real work to create the file.

I found out in Windows there is a command you can use:
fsutil file createnew [filename] [size]

where:
filename = The filename for the file you are creating
e.g. file.txt or C:\Directory\file.txt

size = size of the file in bytes
e.g. 2147483648 for 2Gb

example:
fsutil file createnew twogigabytefile.txt 2147483648


On Mac OS X 10.5 you can use:
mkfile [size] [filename]

where:
filename = The filename for the file you are creating
e.g. file.txt or
~/directory/file.txt

size = size of the file in bytes
e.g.
512 for 512 bytes, or use the following suffixes b = half kilobytes, k = kilobytes, m = megabytes and g = gigabytes, i.e. 10m for 10 megabytes.

example:
mkfile 2147483648 twogigabytefile.txt
or
mkfile 2g twogigabytefile.txt

Labels: ,

Monday, April 27, 2009

How to Extract the contents of an MSI Installer File

Have you ever wanted to just get at the contents of an MSI file, without having to install the whole application or library? It's easy, just use the following command at the console:

msiexec /a yourmsifile.msi /qb TARGETDIR=C:\extracted


Note the TARGETDIR must be an absolute path.

Labels: