def quote_fname(fname):
    """quote file name or any string to avoid problems with file/directory names
	that contain spaces or any other kind of nasty characters
	"""
    return '"%s"' % (
		fname
		.replace('\\', '\\\\')
		.replace('"', '\"')
		.replace('$', '\$')
		.replace('`', '\`')
		.replace('!', '\!')
		)