Os-prober cannot find Windows

sudo grub-mkconfig didn’t worked so I tried the 2nd method and after doing that I got an error saying:

Generating Grub configuration file...
Script `/boot/grub/grub.cfg.new' contains no commands and will do nothing
Syntax errors are detected in generated GRUB config file.
Ensure that there are no errors in /etc/default/grub
and /etc/grub.d/* files or please file a bug report with
/boot/grub/grub.cfg.new file attached.

I solved this problem by undoing sudo mv /etc/grub.d /etc/grub.d.old command. I reinstalled grub using grub-install --target=x86_64-efi --efi-directory=/boot/efi --bootloader-id=manjaro --recheck maybe this command was faulty and caused that problem. But in the end neither the first and second method solved the problem and grub still doesn’t see Windows