Getting rid of “there was a problem sending the command to the program” without compromising security

Description of the problem:

You have a config file that you want to edit in Visual Studio. You don’t want to open the entire project, to just make a quick change, and you right click on the file, and select Open with Visual Studio. At that point you get this error message (noted above) and visual studio opens, but there is no sign of the file.

 

How thinking you are clever, almost always turn out to prove the opposite:

If you have the user account control fairly strict, then each time you open a web project, Visual Studio will tell you, that you should have launch Visual Studio as an administrator. So this is where I made a huge mistake. Thinking I was very smart, I went to the devenv.exe and set the administrator option on the files compatibility tab.

I figured, that way I will always run the development environment under the right credentials, right?

 

I was VERY wrong. The following is a screen shot of the Security tab, in process explorer of the Visual Studio launched with the compatibility set to Run as Administrator

So let’s compare that to the same screen shot, but of the Explorer process

 

So here is the interesting bit.

The explorer process launches visual studio with the security of the process set to DENY administrators any access. Then we try to launch visual studio in that context, but we say to the operating system, that whenever the devenv.exe process is launched it must always run as administrator. Keeping in mind that the DENY permission, always overrides all other permissions, no wonder there is problems for visual studio trying to open the file.

 

Fixing it without compromising the security of my system:

Undo where you fiddled with the system where you should not have fiddled in the first place.

Create a shortcut, and set the shortcuts properties to run as administrator. So know when you know you need to touch IIS and make changes, then you launch visual studio with your admin shortcut. All other times when you want to modify config files, you run under lower privileges, and you stay safe and secure.

So know I have been made humble again, and hopefully will respect the security of the system a bit better.

 

2 Responses to Getting rid of “there was a problem sending the command to the program” without compromising security

  1. xploder says:

    xploder…

    [...]Getting rid of “there was a problem sending the command to the program” without compromising security « Rihan Meij[...]…

  2. Jaime says:

    Unfortunately, this is not the end of the story. Once you open the file by double-clicking so you can edit it you can nolonger save it. You open using your shortcut and have to manually open it by navigating to the directory and file. This becomes really annoying if you are are editing a file such as hosts or something that needs the security. You can certainly add an environment variable to get there quicker. However, there are project config files that, whenever creating new web projects, you should be able to quickly double click, make changes and then close. This isn’t possible anymore without comprimising your security.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Connecting to %s

Follow

Get every new post delivered to your Inbox.