My EXE is not running if change the setting as you suggested.
Why doesn't it run? What error do you get? Is that C++ code? Is it a command line program or a GUI?
Configure the task scheduler to run a .bat file that calls your program.
@echo Bat file starting at %date% %time%
C:\TheDirectoryWhereYouPutTheProgram\TheEXE.exe /AnyArgumentThatYouPassToIt
@echo Program ended RC=%errorlevel%
@echo Bat file ending at %date% %time%
In the Task definition, configure it to run the program cmd.exe. In the arguments, you need to pass the /c switch, the name of the .bat file, and capture stdout and stderr.
Like this
cmd.exe /c C:\TheDirectoryWhereYouPutTheProgram\CallMyEXE.bat 1>c:\MyLogDirectory\MyEXE.log 2>&1
Here's an example of what it should look like.
After the task runs, examine the log and see what output your program produced.