if ((exists folder “%SYSTEMDRIVE%\ABCD”) or (exists folder “%ALLUSERSPROFILE%\Application Data\ABCD”)) then (if exists file “c:\120409.txt” then False else True) else False
Anytime you find yourself writing ‘if Something then True else False’, you can rewrite your query to be more succinct by removing the if clause. So instead of this:
if ((exists folder “%SYSTEMDRIVE%\ABCD”) or (exists folder “%ALLUSERSPROFILE%\Application Data\ABCD”)) then (if exists file “c:\120409.txt” then False else True) else False
Try this:
if ((exists folder “%SYSTEMDRIVE%\ABCD”) or (exists folder “%ALLUSERSPROFILE%\Application Data\ABCD”)) then (exists file “c:\120409.txt”) else False
But better yet:
exists folder ( name of drive of system folder & “\ABCD”) AND exists folder (value of variable “ALLUSERSPROFILE” of environment & “\Application Data\ABCD”) AND not exists file “c:\120409.txt”
exists folder ( name of drive of system folder & “\ABCD”) OR exists folder (value of variable “ALLUSERSPROFILE” of environment & “\Application Data\ABCD”) AND not exists file “c:\120409.txt”