Checking for existing .exe file
why when i want to check .exe file this program will print false but when i add .txt file and check prints True?
i mean its only recognize .txt file not .exe.
int main(int argc, char *argv)
QCoreApplication a(argc, argv);
QFile read("C:\Users\Ramin\AppData\Roaming\Microsoft\Windows\Start Menu\Programs\Startup\Time.exe");
Are you sure the path that you have passed into QFile constructor is correct.
May it is file problem .
just recheck path,file name etc .again.
also check in different drives.
BTW.Your code is correct.
It's also very unlikely that you have an executable file in that folder. You should rather have a symbolic link to that executable located in e.g. Program Files or Program File (x86)
On a side note, since you are using Qt, you can (and should) use the forward slash unix notation, it's less error prone.