Program not running from 'Run' registry key - windows

I have written a program in C# which I would like to open automatically at startup. As such, I have added a value to the HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Run key:
Name: CustomTaskbar
Data: "C:\Users\test\Documents\CustomTaskbar\CustomTaskbar.exe"
Unfortunately, when I login, I am encountered with an error. Windows says 'CustomTaskbar has stopped working' and the details say this:
Files that help describe the problem:
C:\Users\test\AppData\Local\Temp\WERECE7.tmp.WERInternalMetadata.xml
C:\Users\test\AppData\Local\Temp\WERF655.tmp.appcompat.txt
C:\Users\test\AppData\Local\Temp\WERF823.tmp.mdmp
I have no idea why this is happening, as it works just fine when I run it manually, either via Windows Explorer or cmd.
I have written the program in C#. Do I have to add anything to the code in order to make it compatible with the registry key?
I apologise in advance if this is a stupid question, with a simple answer, but I cannot find any fix online.
Thanks.

Following the instructions provided by the link (https://stackoverflow.com/a/3133249/17034) kindly provided by Hans Passant, I was able to catch the exception. It turns out that while I had thought it was an issue with the way Windows was running it, it was in fact a stupid error on my behalf. I was referencing local paths like ”appfolder” and ”config.xml”. Windows was running the program from the system32 directory and, as the program did not have admin privileges, it was throwing an error, saying it couldn’t write to them.
I feel utterly ridiculous for having not noticed what would be happening before.

Related

Determine Cause of Run-time error '429': ActiveX component can't create object

I have inherited a program written in VB 6 that is not working when the user tries to print. I had some ocx files I needed to register (regsvr32), which I found using Process Monitor, but I can't see where this error is coming from. Is it possible to find out what component the program was trying to create? This program was written by someone else and I don't have access to anything but the original setup program. Thanks.
So the issue was not the old program, but something to do with Access. I happened upon some articles dealing with this particular issue, but nothing worked. I had to install Access 2013 32 bit in order to make this work. I didn't really fix the cause of the problem, but I wanted to put this here to point any future sufferers they check Office and their program if they run into a similar issue.
HTH
Wade

ExcelDna not working on one machine

As far as I can detect all machines are the same that excelDna is being used on.
On one specific machine I tried to use the code I have created, and ran into an issue. Logically I thought this was odd and instead tried to add a sample file that comes with the download.
So now, I am trying Errors.xll/Errors.dna that come as a sample. The same error occurrs. Therefore to me there is an issue on this specific machine.
The error I am receiving is "a problem occurred while an add-in was being initialized (InitialIntegration failed). The add-in is built with ExcelDna and is being loaded from P:\xlDna\Distribution\Errors.xll"
Has anyone encountered this? Help needed to understand why this is happening as it seems quite opaque to debug.
Hi what solved this for me was moving the xll and DNA to the users c:. Once located on the c: worked flawlessly.
Hope this helps someone else in the future.

System.Net tracing in PowerShell

I am trying to get tracing set up for PowerShell(ISE) and I came across this link, but I am running debugView, and nothing seems to be happening. Anyone know what I am doing wrong?
Basically my goal is to get tracing for System.Net.WebRequest working in PowerShell. If there is another way to do it, I'd also be open to that.
The answer - which is mine funnily enough - in that link refers to the regular console (powershell.exe) version of powershell. I have to ask some dumb questions:
You created a powershell_ise.exe.config file, not powershell.exe.config, right?
If you're viewing dbgview over remote desktop, you enabled "capture global win32," right?
You have capturing enabled on dbgview, right?
-Oisin

I have a delphi 7 program running on windows 2008 and I get "folder does not exist" error

I've asked the very same question here :
Why does my program say "folder does not exist" when run on Windows 2008?
but none of the answers were satisfying and my problem still exists , so I decide to ask it in another way with more detail cause this problem really irritate me and we need to solve this , otherwise we have to write the similar application in another language which means waste of our time.
program written in delphi 7(32 bit)
environment running this program is : windows 2008 r2 64-bit
the task program try to do : creating 3 folders then copy an sound file and compress it using lame commmand line (lame.exe) and save changes into database
error I get : "THE 'folder' does not exist . the file might have been moved or deleted , Do you want to create it?" and it cause the program become halted
things I have done :
1- try to run the program as an administrator
2- check eventlog but no clue
3- triple check the required folder and all of them was correct
4- read this KB: http://support.microsoft.com/kb/927387
BUT still I am seeing this bloody error.
I have uploaded the picture of the error here as you see it clearly :
http://i28.tinypic.com/9to6qr.jpg
The folder name is C:\Upload_ABC\\2010\07\27\:
please notice I haven't written that unwanted dialog-box inside my program I believe windows 2008 attach it or bring it on my application.
please please please give me some idea or let me know what should I do ?
best regards.
C:\Upload_ABC\\2010\07\27\
You have two backslashes in your path. Use debugger to see why.
Have you checked the access rights for that folder structure with regard to the account the Delphi program is running from? Windows Server systems tend to be more restrictive in what a user is allowed to do than Windows on workstations are.
In addition I suggest to strip down a copy of the program to the relevant functionality to show the error. With this you get at least a chance that anyone around may test it on another system.
Furthermore you can try to compile it with D2010 and see wether the error persists. If it does, you might have a chance to find the problem running the D2010 debugger. If you don't have D2010 at hand, you might install the trial just for this purpose.
What is between the two consecutive backslashes in your path? Is there really nothing between them or have some characters been removed because they are Unicode and D7 doesn't support Unicode?
As there is nothing in between the two consecutive backslashes...
It does sound like Windows is getting its grubby little fingers in between your program and your access of the files. Either the folders have not been created, or you are being denied access once they have. And as the changes you are trying to store in your database involve compressed files, virtualization seems to be the culprit as explained by the link you yourself provided.
A couple of avenues to try:
Remove any compatibility settings on your exe (right click|properties|Compatibility tab) that could trigger Windows to butt in. Also don't forget this can be triggered by things like "setup" or "update" as part of the executable name.
"Save your application's data in a folder under your user profile."
Such as c:\users\\documents or some such (better not hardcode it in actual production code, but ok for debugging). That after all is exactly the advice the linked msdn article is giving for scenario 2 "you cannot find the files or folders you just created"
If you can't debug on the machine where it is running, go back to old school debugging: add trace messages to your code to show where in the code you are (and have been) and show them in a memo on a separate form or some such.
Make sure you don't "eat" any exceptions that could give you extra information about what is going on.

Strange, possible “shadow copy” issue where two editors show different contents

I have some code that is reading a config file, but when I open the file in TextPad, I see different values than my application does. I checked it with Notepad. Notepad agrees with my application, TextPad shows something else.
This is on Vista x64 Business.
Any idea what could be causing this? I've looked in the Context Menu->Properties->Previous Versions details, but it says "There are no previous versions available".
Here's the steps to replicate (I can't make it happen reliably):
Installed .NET app in Program files.
That app reads the config file, but is falling over.
I manually edit that config file in Textpad.
The change doesn't take effect.
I open the config file in Notepad, and see something different.
Try making the change in Notepad and saving, and get this error message:
Notepad
Cannot create the C:\Program Files (x86)\Daniel Schaffer\WorkingOn for FogBugz\FogBugz > WorkingOn.exe.config file.
Make sure that the path and file name are correct.
I can't put the content here as it's XML and is being encoded by Superuser.com, but here's a link to a screencast: http://screencast.com/t/zhERl7mocp4.
Sounds like a case of you don't have administrator privs, when you installed your app. Sometimes when you install an app with no admin privs, it behave really strangely because of vista security model. I had a similar problem to this last year. It wasn't the exactly, but it was strange behaviour, until I figured out it was vista's security model. It elevates it into application/user security context, from what I know, as my brain froze when I was reading about it, as it was pure muck and virtually useless from what I can see.
Try opening Textpad (excellent app) with Run as Administrator, and then edit the config. See what happens. If it stays then same then its a prives problem. If that doesn't work, deinstall you app, and then install it as an administrator. That will give the app the write admin privs to work. Then when you edit the config. See if that works.
Take a look at this. You can elevate an app to run as administrator, Using the techniques found here. How to elevate an application.. Try all these before you do a reinstall.
If that doesn't work, post your question to server fault. Also post it to a suitable MSDN forum.
Hope that help.
Bob.
This is interesting. My guess is that a Vista Feature called UAC Virtualization (aka Data Redirection) is at work here. It basically redirects legacy applications to %USERPROFILE%\AppData\VirtualStore\Program Files\... so they can write files in the program's directory.
Maybe Textpad tries to open the file in read-write mode while both your application and Notepad use it read-only?
You can fire up Process Monitor to see the exact magic, and please let me know ;-)
Try just to strip that whitespace character from application name; my guess is something related to canonical path building
try to copy file to another path and reopen it. see if it changes the result.
One thing you can do is observe what exact file each of those methods ends up opening. To do this,
launch Process Monitor from the sysinternal suite.
look only for file operations (deselect registry operations on the right of the toolbar)
select only your own process (filter out all the processes that you don't care about, or just include your own process name in the filter list)
You can also simply use the search function for your file name, this might be the faster route.
Process monitor has helped me find so many issues it's amazing.

Resources