Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

C# System32 issue

Posted on 2014-11-18
2
Medium Priority
?
373 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 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

Prepare for your VMware VCP6-DCV exam.

Josh Coen and Jason Langer have prepared the latest edition of VCP study guide. Both authors have been working in the IT field for more than a decade, and both hold VMware certifications. This 163-page guide covers all 10 of the exam blueprint sections.

Question has a verified solution.

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

Entity Framework is a powerful tool to help you interact with the DataBase but still doesn't help much when we have a Stored Procedure that returns more than one resultset. The solution takes some of out-of-the-box thinking; read on!
Exception Handling is in the core of any application that is able to dignify its name. In this article, I'll guide you through the process of writing a DRY (Don't Repeat Yourself) Exception Handling mechanism, using Aspect Oriented Programming.
This is my first video review of Microsoft Bookings, I will be doing a part two with a bit more information, but wanted to get this out to you folks.
Visualize your data even better in Access queries. Given a date and a value, this lesson shows how to compare that value with the previous value, calculate the difference, and display a circle if the value is the same, an up triangle if it increased…

664 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