An unexpected error occurred: pywintypes.error: (3, 'CreateDirectory', 'The system cannot find the path specified.')

Please fill out the fields below so we can help you better. Note: you must provide your domain name to get help. Domain names for issued certificates are all made public in Certificate Transparency logs (e.g. |, so withholding your domain name here does not increase secrecy, but only makes it harder for us to provide help.

My domain

I ran this command: certbot certonly --webroot (from administrator cmp)

It produced this output:
"An unexpected error occurred:
pywintypes.error: (3, 'CreateDirectory', 'The system cannot find the path specified.')
Ask for help or search for solutions at See the logfile C:\Users\ADMINI~1\AppData\Local\Temp\3\certbot-log-6ngas9k6\log or re-run Certbot with -v for more details."

My web server is (include version):nginx

The operating system my web server runs on is (include version): windows 10

My hosting provider, if applicable, is:

I can login to a root shell on my machine (yes or no, or I don't know): yes

I'm using a control panel to manage my site (no, or provide the name and version of the control panel):

The version of my client is (e.g. output of certbot --version or certbot-auto --version if you're using Certbot): certbot 2.0.0

im attaching the log file:

C:\Users\ADMINI~1\AppData\Local\Temp\3\certbot-log-6ngas9k6>type log
2022-12-04 17:51:39,373:DEBUG:certbot._internal.main:certbot version: 2.0.0
2022-12-04 17:51:39,373:DEBUG:certbot._internal.main:Location of certbot entry point: C:\Program Files\Certbot\bin\certbot.exe
2022-12-04 17:51:39,373:DEBUG:certbot._internal.main:Arguments: ['--webroot', '--preconfigured-renewal']
2022-12-04 17:51:39,373:DEBUG:certbot._internal.main:Discovered plugins: PluginsRegistry(PluginEntryPoint#manual,PluginEntryPoint#null,PluginEntryPoint#standalone,PluginEntryPoint#webroot)
2022-12-04 17:51:39,413:DEBUG:certbot._internal.log:Exiting abnormally:
Traceback (most recent call last):
File "", line 197, in _run_module_as_main
File "", line 87, in run_code
File "C:\Program Files\Certbot\bin\certbot.exe_main
.py", line 29, in
File "C:\Program Files\Certbot\pkgs\certbot\", line 19, in main
return internal_main.main(cli_args)
File "C:\Program Files\Certbot\pkgs\certbot_internal\", line 1726, in main
File "C:\Program Files\Certbot\pkgs\certbot_internal\", line 107, in post_arg_parse_setup
file_handler, file_path = setup_log_file_handler(
File "C:\Program Files\Certbot\pkgs\certbot_internal\", line 161, in setup_log_file_handler
util.set_up_core_dir(config.logs_dir, 0o700, config.strict_permissions)
File "C:\Program Files\Certbot\pkgs\certbot\", line 178, in set_up_core_dir
make_or_verify_dir(directory, mode, strict)
File "C:\Program Files\Certbot\pkgs\certbot\", line 201, in make_or_verify_dir
filesystem.makedirs(directory, mode)
File "C:\Program Files\Certbot\pkgs\certbot\compat\", line 307, in makedirs
return os.makedirs(file_path, mode)
File "", line 225, in makedirs
File "C:\Program Files\Certbot\pkgs\certbot\compat\", line 340, in mkdir
raise err
File "C:\Program Files\Certbot\pkgs\certbot\compat\", line 334, in mkdir
win32file.CreateDirectory(file_path, attributes)
pywintypes.error: (3, 'CreateDirectory', 'The system cannot find the path specified.')
2022-12-04 17:51:39,414:ERROR:certbot._internal.log:An unexpected error occurred:
2022-12-04 17:51:39,414:ERROR:certbot._internal.log:pywintypes.error: (3, 'CreateDirectory', 'The system cannot find the path specified.')

Hi @eyal1986, and welcome to the LE community forum :slight_smile:

Have you tried running that command from an administrative prompt?
[not sure what you meant by: "(from administrator cmp)"]


Does C:\Certbot exist? On Windows, it needs to exist, even if you have installed Certbot somewhere else.


Yes. I run it from admin prompt

thank you. this helped. i moved to certbot folder to c:\certbot folder

1 Like

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.