Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

C# System32 issue

Posted on 2014-11-18
2
Medium Priority
?
396 Views
Last Modified: 2014-11-19
I wrote using C# program and copy to exe file in the system32 folder.
(C:\Windows\System32)
My computer is Windows 7 Professional and 64 bit operating system

After copy to exe file in to the system32 folder im geeting Error. (when im try to Run the exe file)

Please find the attached file for the error
Error-Reports.png
0
Comment
Question by:ukerandi
2 Comments
 
LVL 36

Expert Comment

by:Miguel Oz
ID: 40451033
Could you click yes and post the extra info?
In the mean time, check how the build is done for your EXE: Is the Platform target AnyCPU, x86 or x64?
0
 
LVL 16

Accepted Solution

by:
Vikram Singh Saini earned 2000 total points
ID: 40451464
Two points -

1. Try executing your application from other folder other than system folders.

2. If execute, then to run same application from system folder, you will need to run application with Administrator permissions.

Other solution-

Credit goes to This application could not be started.” Only when the file is in system32 directory

Short Answer: Uncheck "Prefer 32-bit".

Long Answer: (Not 100% sure but here goes)

Assuming you have a 64 bit machine, keep in mind that System32 is a folder that is reserved for 64 bit application usage, and although it may seem strange, SysWOW64 contains 32 bit dlls and is reserved for 32-bit applications. Typically, 32-bit applications that access System32 will go through a file system redirector to the SysWOW64 folder. More info here.

However, when your application (which runs as a 32-bit process) runs in System32 itself, the redirector probably doesn't do anything because it thinks there isn't any need to redirect, which is why your app works outside of System32 but not inside it.

So to solve this, uncheck Prefer 32-bit so that it will try to target 64 bit platform, ... or better yet, put the app elsewhere and add the application directory to your environment path variable. That way you can still access your application .exe anywhere, and it won't pollute your System32 folder which should only be used for Windows files anyways.
0

Featured Post

NEW Veeam Backup for Microsoft Office 365 1.5

With Office 365, it’s your data and your responsibility to protect it. NEW Veeam Backup for Microsoft Office 365 eliminates the risk of losing access to your Office 365 data.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Calculating holidays and working days is a function that is often needed yet it is not one found within the Framework. This article presents one approach to building a working-day calculator for use in .NET.
It was really hard time for me to get the understanding of Delegates in C#. I went through many websites and articles but I found them very clumsy. After going through those sites, I noted down the points in a easy way so here I am sharing that unde…
This course is ideal for IT System Administrators working with VMware vSphere and its associated products in their company infrastructure. This course teaches you how to install and maintain this virtualization technology to store data, prevent vuln…
Look below the covers at a subform control , and the form that is inside it. Explore properties and see how easy it is to aggregate, get statistics, and synchronize results for your data. A Microsoft Access subform is used to show relevant calcul…
Suggested Courses

972 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question