I need to write a very basic program in C to do some calculations for a colleague at work (not at all an entirely IT literate workplace) and from my experience, running any .exe in windows (7) makes it have an absolute fit, sometimes preventing it from running the program at all. Is there any way I can make the program just run without a fuss for my colleague?

EDIT: By 'have an absolute fit' I mean windows will either stop the user from running the .exe entirely, or ask for user permission x amount of times etc. It would probably be solved by turning UAC off, but trying to explain something even as simple as that down the phone probably isn't an option.

It's difficult to tell what is being asked here. This question is ambiguous, vague, incomplete, overly broad, or rhetorical and cannot be reasonably answered in its current form. For help clarifying this question so that it can be reopened, visit the help center.
If this question can be reworded to fit the rules in the help center, please edit the question.

Running programs in Windows 7 is not really any different from any other versions of Windows. I don't know what you mean by "have an absolute fit" but you must be doing something wrong. Why don't you spend a bit more time and tell us what the problem is.
–
David HeffernanJun 23 '11 at 8:48

MSVS2010... Sorry, I should have described it better, will update the question.
–
AnonymousJun 23 '11 at 8:50

2

Perhaps you should edit your question to remove references to the phrase "have an absolute fit". You'd be more likely to get upvotes on your question that way.
–
MatthewDJun 23 '11 at 8:54

It might also staunch the flow of close votes.
–
David HeffernanJun 23 '11 at 9:01

2 Answers
2

Two suggestions:
a) Use static linking, try to include all exec you need to your application. Provide all dependencies that you can not link statically with your app. To check dependencies, use DependencyWalker for example.

No, don't run as administrator. That's hiding the problem rather than dealing with it and it's exactly what OP has asked to avoid since running as admin results in UAC dialogs. It's also somewhat unhelpful if the program is a console app (hard to invoke, have to create an admin cmd.exe process). And it's no use whatsoever if the user doesn't have admin rights and has to ask IT support to come and do over the shoulder elevation!
–
David HeffernanJun 23 '11 at 8:57

Yes, another way is to rewrite program without using functions that needs admin rights, as you suggest. But that is not always possible.
–
RaivJun 23 '11 at 9:03

Do you really believe that OP requires admin rights based on the information provided? It's exceedingly unlikely. Anyway, if you go down that route it doesn't solve OP's problems because OP wants to avoid UAC dialogs. The way to solve that is to avoid requiring admin rights, of that there can be no debate.
–
David HeffernanJun 23 '11 at 9:10

about half a year ago i was forsed to split my application to service part and client ui part to avoid UAC messages... but if it is simple app - yes, restricted folders may cause the problem, and that would be easier to rewrite app without using them.
–
RaivJun 23 '11 at 9:14