If it's supposed to be outside of Windows... and you're trying to use Windows.h... does that make any sense? Anyway, it looks like you're trying to create a bootloader of sorts. Autoexec.bat is called after the default bootloader, I just thought I'd let you know. And, all that you are trying to do is easily accomplished WITH a batch file. I suggest you learn them inside out... man, it was fun tweaking BAT files back in the day...