Reputation:
My program run fine from anywhere else on my drive apart from the Program Files directory (windows XP), I am logged on as administrator so I have full permissions to the drive. It runs fine from the root of c: the windows directory basically anywhere else apart from Program Files. I have recreated this problem on 4 different machines 2 XP, 2 Vista.
My program is a C# .Net 2.0 program. What on earth could the problem be?
I have even copied my entire project to the Program Files directory and I can't debug it from there it just won't run up, no errors at all.
Thanks for any help.
Upvotes: 1
Views: 2594
Reputation:
Sorry about this but I found the problem, I had some crap code that was looking for arguments being passed including 'file' and the file in 'program files' was forcing the program into a command line mode that has no gui. Really sorry to have wasted your time on such a trivial problem, you live and learn!
Thanks to all.
Upvotes: 0
Reputation: 30234
Have you got any thing like Anti-virus software running?
Which is it?
Have you checked the Event Logs?
Try calling it from a batch file and see what happens.
uhmm anyone want to try his .exe on their machine??
Upvotes: 0
Reputation: 9240
What does your programm read in its directory?
Why are you creating a temp file in user/appdata? For temporary files, you should use the API to get the temporary folder for the current profile and ideally an temporary filename, works like this:
string tempFilePath = Path.Combine(Path.GetTempPath(), Path.GetTempFileName());
To help you properly, we need to know what your program should do on init.
Upvotes: 0
Reputation:
I've tried the program on a fresh XP install that doesn't have any orgranizational policies applied.
:-(
Upvotes: 1
Reputation: 7817
If this is a machine managed by your company's "big brother", it sounds like only "allowed" applications can run from "Program files"
Upvotes: 0
Reputation: 53366
If you can't debug, you can always create a debug log. It is a bit slow, but in the end you will find the place where the program stops working.
LogDebug('before 1');
Statement1;
LogDebug('before 2');
Statement2;
LogDebug('before 3');
Statement3;
LogDebug('after 3');
Upvotes: 2
Reputation:
The program does run from other folders with a space in the path such as Documents and Settings, the program does create a temporary file in the user profile\appdata folder.
If I run the app several time from somewhere it will run from I've just noticed I get an error with the option to debug but VS won't show me the location of the problem I just get the error belo.
Unhandled exception at 0x79fb96a2 in test.exe: 0xC0000005: Access violation reading location 0x0000000c.
The problem can be recreated on XP and Vista.
Many thanks
Upvotes: 0
Reputation: 9240
Just guessing, but if your program tries to save data to the program-directory, Vista will prevent this and change the path dynamically to something like c:\users[user]\AppData. Maybe this gives you a hint on whats going on.
Otherwise we need more info on your program to help you.
Upvotes: 2