Solved

C# System32 issue

Posted on 2014-11-18
2
344 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
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 500 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

Get your Conversational Ransomware Defense e‑book

This e-book gives you an insight into the ransomware threat and reviews the fundamentals of top-notch ransomware preparedness and recovery. To help you protect yourself and your organization. The initial infection may be inevitable, so the best protection is to be fully prepared.

Question has a verified solution.

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

Many of us here at EE write code. Many of us write exceptional code; just as many of us write exception-prone code. As we all should know, exceptions are a mechanism for handling errors which are typically out of our control. From database errors, t…
This article shows how to deploy dynamic backgrounds to computers depending on the aspect ratio of display
There's a multitude of different network monitoring solutions out there, and you're probably wondering what makes NetCrunch so special. It's completely agentless, but does let you create an agent, if you desire. It offers powerful scalability …
Sometimes it takes a new vantage point, apart from our everyday security practices, to truly see our Active Directory (AD) vulnerabilities. We get used to implementing the same techniques and checking the same areas for a breach. This pattern can re…

635 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