shortcut "Run as administrator" checkbox is disabled

  • Thread starter Thread starter John A Grandy
  • Start date Start date
J

John A Grandy

I right-click on a .sln ( Visual Studio solution file ) to "Send to >
Desktop ( create shortcut )" ...

However, on my shortcut, right-click Properties > Advanced reveals that the
"Run as administrator" checkbox is disabled ...

How to create a shortcut that "Runs as administrator" the target executable
?
 
John A Grandy said:
I right-click on a .sln ( Visual Studio solution file ) to "Send to >
Desktop ( create shortcut )" ...

However, on my shortcut, right-click Properties > Advanced reveals that
the "Run as administrator" checkbox is disabled ...

How to create a shortcut that "Runs as administrator" the target
executable ?


Is a *.sln file an executable?
 
Gordon said:
Is a *.sln file an executable?


I did not ask the question but I will say that it is not. A sln is a file
with Visual Studio (VS) projects in it. Projects of course has source code
file names and build options. So a sln file is associated with VS in the
same manner that a doc file is associated with Word.
 
I have used VS since before it was Visual Studio; that is, I used the
Microsoft C compiler before it became Visual C++ and Visual C++ before it
was a part of Visual Studio. I have never used the Administrator account for
any programs except for a few projects that require Administrator privileges
or at least elevated privileges. Unless you are developing a project you are
sure you need Administrator privileges for then don't use Administrator
privileges. You might have to add Debug privileges to your account (user id)
or use a different account that does have it, but don't use an Administrator
account unless you are sure you must.

Also, the MSDN says you must use Administrator privileges for some of the
samples; I think it is the Northwind samples. Probably that is due to the
location in Program Files. You can eliminate that requirement; do something
such as copy the files elsewhere or change the security for the relevant
directories. Probably copying the files is the best solution but I think
there are some setup properties that will specify the Program Files
location. Go to the MSDN forums for help with that. Use the Help menu to
find the MSDN forums.

If you must use Administrator privileges, then you can execute VS as an
Administrator, but as Gordon's reply implies, you probably (I am not sure)
cannot specify that a solution file must be opened (it is not actually
executed) using Administrator privileges.

I get the impression you have a lot to learn; you probably need a good book
and if you ask a question in a MSDN forum without using available resources
such as reading the documentation and reading books, you will soon be told
in a MSDN forum that that is what you need to do.
 
John said:
I right-click on a .sln ( Visual Studio solution file ) to "Send to >
Desktop ( create shortcut )" ...

However, on my shortcut, right-click Properties > Advanced reveals that
the "Run as administrator" checkbox is disabled ...

How to create a shortcut that "Runs as administrator" the target
executable ?

You cannot set it on a .sln file for VS, as it's not an executable file.
If you need to Run As Administrator with VS for a VS solution within the
VS IDE, then you set the Run As Administrator on the VS short-cut that
points to the location below. That would be the icon that looks like an
8 turned on its side, which is the VS short-cut icon and using the
Advanced button to permanently set configuration.

"C:\Program Files\Microsoft Visual Studio 9.0\Common7\IDE\devenv.exe"

You start VS up off of its short-cut, it's always set to Run As
Administrator and you create new a project, solution or Web site or open
as existing one, then you have the power of using VS with Run As
Administrator.

You right-click an exe that was complied/built in the *bin* directory of
a VS solution and send the short-cut to the desktop, then you can set
Run As Administrator on that exe.
 
Jack the Ripper said:
You cannot set it on a .sln file for VS, as it's not an executable file.

As I also said.
If you need to Run As Administrator with VS for a VS solution within the
VS IDE, then you set the Run As Administrator on the VS short-cut that
points to the location below.

Most projects don't need that, but I know that many developers do that.
You right-click an exe that was complied/built in the *bin* directory of a
VS solution

Yes, if it is a C# project. For a C++ project the Debug and Release
directories are in the project directory (by default). I think VB also does
not use the bin directory for any projects (by default).
send the short-cut to the desktop, then you can set Run As Administrator
on that exe.

If VS is run as an Administrator, then that is probably not necessary for
debugging/testing purposes. Anything executed by VS will also run as an
Administrator. Most executables won't need elevated privileges and if they
do an experienced programmer should attempt to require the least privileges
necessary. There is a lot to learn so I can understand that someone
beginning to learn would take the easy route of using Administrator
privileges.
 
Back
Top