Solved

C# System32 issue

Posted on 2014-11-18
2
273 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 35

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

Why You Should Analyze Threat Actor TTPs

After years of analyzing threat actor behavior, it’s become clear that at any given time there are specific tactics, techniques, and procedures (TTPs) that are particularly prevalent. By analyzing and understanding these TTPs, you can dramatically enhance your security program.

Join & Write a Comment

Suggested Solutions

Title # Comments Views Activity
asp.net bundle 8 36
Word Template Mail merge with vb.net 4 40
comparing string in C# 3 33
AutoHotkey ActiveX Component Error 8 55
This document covers how to connect to SQL Server and browse its contents.  It is meant for those new to Visual Studio and/or working with Microsoft SQL Server.  It is not a guide to building SQL Server database connections in your code.  This is mo…
Introduction Hi all and welcome to my first article on Experts Exchange. A while ago, someone asked me if i could do some tutorials on object oriented programming. I decided to do them on C#. Now you may ask me, why's that? Well, one of the re…
In this tutorial you'll learn about bandwidth monitoring with flows and packet sniffing with our network monitoring solution PRTG Network Monitor (https://www.paessler.com/prtg). If you're interested in additional methods for monitoring bandwidt…
This tutorial demonstrates a quick way of adding group price to multiple Magento products.

706 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

Need Help in Real-Time?

Connect with top rated Experts

16 Experts available now in Live!

Get 1:1 Help Now