I set some post-build commands in Visual Studio 2017 that should allow me to run a program that I currently have in System32 (wsl.exe). However, Visual Studio doesn't see the program.
I tried to set the command to dir C:\Windows\System32\
to see all the files it could list, and in fact it doesn't list over a 1'000 files out of the around 4'600 files I have there, including the wsl.exe
file I'm trying to run. The number of files show up correctly when running the same command in the command prompt.
I've tried to run whoami
as the post-build command, and it returns the same user as if I run the same command in the command prompt.
Am I missing something?
Click on the "Appearance and Personalization" link. Then click "Folder Options." Go to the "View" tab. Deselect the box next to "Hide protected operating system files (Recommended)." In Windows Vista, select "Show hidden files and folders." In Windows 7, select "Show hidden files, folders, and drives." Click "OK."
A required Microsoft Windows system directory, the System32 directory is located in either C:\Windows\System32 or C:\Winnt\system32 directory. The system32 directory contains Windows system files and software program files, vital to the operation of the Windows operating system and software programs running in Windows.
Typing cd \ will move you from any folder on the drive to the root folder of that drive. If you're in C:\Windows\System32 , type cd \ and press Enter to move to C:\ . If the path has spaces, enclose it in double-quotes.
The PLASRV.EXE file only exists in system32. Doing a DIR from the cmd line find the file. Outside using CreateFile on the backend to determine if a file exists, which is what both of the methods done so far do, the other way is to use FindFirstFile/NtQueryDirectoryFile which is what I believe cmd does.
"Show All Files" option found on the top of solution explorer. Honestly, I hadn’t even noticed before that solution explorer has a “Show All Files” option. Turning this on show everything in your solution folder that isn’t part of the project.
If you set “Show All Files”, you can select an existing folder that is not part of the project, and “Include In Project”. This solved my issue, but it may also come in handy in the future when manually adding third-party libraries, or just viewing the node_modules folder.
It only shows the files and folders that are included in your project by default. At the top of the solution explorer panel there should be a button that says "Show All Files" which will allow you to select grayed-out ones that exist but aren't included yet, right click them, and say "Include in Project".
Visual Studio itself is 32-bit application. As such, the OS shims the application behavior to a different view of the Windows and System32 folders. i.e c:\Windows\System32
in the application is actually the c:\Windows\SysWow64
folder for 32-bit apps. That explains why it can't see the wsl.exe binary... Not sure what the workaround is... looking into this...
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With