M
Mark
I've had a problem with getting a small c# app that I've written to run at a
particular user login on XP. I've added a reference to it into the registry
locations:
HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Run (first
attempt)
HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion\Run (second
attempt)
Basically, it doesn't run! Other apps in the same keys run without problems.
So, I decided to pare-down the code to see if it was something I'd coded.
Eventually, I ended up with this:
namespace WindowsApplication1
{
public class Thing : System.Windows.Forms.Form
{
public Thing()
{
}
static void Main()
{
// while(true) {}
System.Diagnostics.EventLog.WriteEntry("Test", "Testing...");
}
}
}
Still, the app doesn't run at login. I've uncommented the infinite loop to
see if it was running but just not logging anything (crude but effective!).
Still nothing (i.e. no 100% CPUI activity). There are no errors in any of
the event logs. What I do know is:
- It works fine on a Win 2000 box
- I've only tested it on one XP Pro box as that's all I have access to so
perhaps it's just my PC? (I have all the latest patches etc.)
- The .Net version is 1.1
- I've had a look on the newsgroups and the MS web site but could find
anything there about this.
- I don't know if it's C# only as I don't have VB.net to try it on!
Am I missing something obvious here (as in perhaps it's well-known that .Net
apps can't be added to autorun at logon)?
TIA
Mark
particular user login on XP. I've added a reference to it into the registry
locations:
HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Run (first
attempt)
HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion\Run (second
attempt)
Basically, it doesn't run! Other apps in the same keys run without problems.
So, I decided to pare-down the code to see if it was something I'd coded.
Eventually, I ended up with this:
namespace WindowsApplication1
{
public class Thing : System.Windows.Forms.Form
{
public Thing()
{
}
static void Main()
{
// while(true) {}
System.Diagnostics.EventLog.WriteEntry("Test", "Testing...");
}
}
}
Still, the app doesn't run at login. I've uncommented the infinite loop to
see if it was running but just not logging anything (crude but effective!).
Still nothing (i.e. no 100% CPUI activity). There are no errors in any of
the event logs. What I do know is:
- It works fine on a Win 2000 box
- I've only tested it on one XP Pro box as that's all I have access to so
perhaps it's just my PC? (I have all the latest patches etc.)
- The .Net version is 1.1
- I've had a look on the newsgroups and the MS web site but could find
anything there about this.
- I don't know if it's C# only as I don't have VB.net to try it on!
Am I missing something obvious here (as in perhaps it's well-known that .Net
apps can't be added to autorun at logon)?
TIA
Mark