EXISTS problem

Cem_KaraerCem_Karaer Member Posts: 281
Hello,

EXISTS('c:\windows\system32\blabla.exe') returns false but it EXISTS. I'm using Windows 7. Have an idea?

Cem
Cem Karaer @ Pargesoft
Dynamics NAV Developer since 2005

Comments

  • SavatageSavatage Member Posts: 7,142
    is this part of a bigger code like "If Exists then......"?

    Are you trying to execute this program to run?
  • Cem_KaraerCem_Karaer Member Posts: 281
    Yes, definitely. If this .exe is there then I try to create an automation object to execute a function in it.
    Cem Karaer @ Pargesoft
    Dynamics NAV Developer since 2005
  • Slawek_GuzekSlawek_Guzek Member Posts: 1,690
    Perhaps it is due to security related stuff on Windows 7, mapping access to c:\windows\system32 to some local directory ? I don't remember exactly where, but it maps files accessed in system directories somewhere if executable is run not under elevated privileges..

    It could be your explorer showing you blabla.exe in c:\windows\system32 when it in fact does not exist there, or it could be NAV testing mapped local folder instead of real c:\windows\system32 ...
    Slawek Guzek
    Dynamics NAV, MS SQL Server, Wherescape RED;
    PRINCE2 Practitioner - License GR657010572SG
    GDPR Certified Data Protection Officer - PECB License DPCDPO1025070-2018-03
  • kinekine Member Posts: 12,562
    cemkaraer wrote:
    Hello,

    EXISTS('c:\windows\system32\blabla.exe') returns false but it EXISTS. I'm using Windows 7. Have an idea?

    Cem

    That you SEE something in some folder, doesn't mean that it is there - this is true for Win 7 and Vista. These OS are able to map folders from "C:\Users\<username>\AppData\Local\VirtualStore\" to the "real" folders to allow lowlevel users to write into protected folders.

    If you are not administrator, you can still install applications etc. But they will be installed into the VirtualStore. But for the application it looks like it is in the C:\Program Files\... If you look into this folder, you can see the files. But if you use another software like Total Commander, the files will not be there, because this software is not using the VirtualStore mapping. If you want to have the files really in the folder, you need to copy them there with leveraged Admin rights. (for more info read about UAC and VirtualStore).
    Kamil Sacek
    MVP - Dynamics NAV
    My BLOG
    NAVERTICA a.s.
  • Cem_KaraerCem_Karaer Member Posts: 281
    The exe file in the system32 folder is a simple command line utility and I chose to put it in the system32 folder, now I decided to move it into some other "normal" folder :). This will be the easiest and smartest way.
    Cem Karaer @ Pargesoft
    Dynamics NAV Developer since 2005
Sign In or Register to comment.