We have a toolkit written in Perl (ActivePerl) and runs on Windows Servers. This toolkit needs to call appcmd.exe at the end of the process, so it always runs as Administrator. All of them work fine, but on one server, the toolkit says it cannot find "C:WindowsSystem32inetsrvappcmd.exe". But it can be displayed in by the command:
Perl is not the only one that cannot find the file. I tried
std::filesystem::directory_iterator("C:WindowsSystem32inetsrv") // C++17 I tried both 32-bit and 64-bit
it doesn’t give me appcmd.exe.
also return a false.
I tried File.OpenRead as this article: Why does System.IO.File.Exists(string path) return false? suggested, but still failed (System.IO.FileNotFoundException) Why I can see C:WindowsSystem32inetsrvappcmd.exe in the folder but unable to access it programmatically?
The answer of System.IO.File.Exists(@"C:WindowsSystem32SnippingTool.exe") returns false doesn’t seem to answer my question. Because all of my client’s Windows server work fine with my toolkit except one.
Is there any setting that can prevent my toolkit from finding C:WindowsSystem32inetsrvappcmd.exe.
Please notice that the toolkit works fine on thousands of my clients’ server, only one server has such issue. It couldn’t be a common feature of Windows. I think probably there is a setting that causes the issue. But I don’t know what causes it. The Read/Write/Execute Permission setting on that server is the same as other servers’.
Source: Windows Questions