<s>[INST] import os
import glob

# Make a file: CopyOfDirectoryListRpt
copied_products = r"C:\Users\sasihaus\OneDrive - AmeriLife\IMS News_\2023\2024endon_attached_reduced_2\Indexing\123175 DO NOT USE"
os.system(f'dir /b > {copied_products}\\CopyOfDirectoryListRpt.txt')
print("Copied Report Folder successfully completed")

## Adding error handling for files with spaces and specific characters
for file in glob.glob(os.path.join(copied_products, 'HUB*OMnisource*pdf'), recursive=True):
    print(file)
   HAMcommand = f'duri {file}"

A small python script that uses `os.system()`to execute a command on windows. I am trying to add glob notation to find files within the directory C:\Users\sasihaus... and all its subdirectories but it does not work correctly. 

When I copy/paste the command from python script and put it in cmd prompt, it does work. 

Here's the code that creates the `duri` command with the filename with spaces and special characters: HAMcommand = f'duri {file}"'

**Question:** How do I properly find files with `glob` knowing the filename may have special characters (like spaces or qa Edward01_q*) and how do I format this filename with special characters when building the `duri` command to be passed to `os.system()`?[/INST]