last day (15 days later) » 

6:39 PM
-2
Q: My startup application not starting in windows XP

Stacy KeblerI have made a startup app which works fine in windows7. when i tried on a different machine which is loaded with windows XP. its not starting.. Also i cannot find the C:\Users\\AppData\Roaming\Microsoft\Windows\Start Menu\Programs\Startup\" in windows XP. I tried copying in different folders.. ...

 
Can you start the application manually? Is there an error?
 
@eddie_cat no error/.. its not starting
 
Check to make sure you have the right version of the .NET framework installed on the XP machine. I'd also add some logging so if there is an error being thrown that you are catching, you can see what it is.
 
@eddie_cat how to know the .net frame work
 
Compare what's installed on the machine to the framework version you created your project with.
Also... there is no AppData folder on XP. I believe it's called Application Data. If you are hard-coding this startup key, you may need to switch it to something else depending on the OS. See the second entry here for %AppData% microsoft.com/security/portal/mmpc/shared/variables.aspx
 
6:39 PM
@eddie_cat in windows 7 i am using C:\Users\<user name>\AppData\Roaming\Microsoft\Windows\Start Menu\Programs\Startup .. So i guess its writeen that in XP the startup is found in C:\Documents and Settings\<user name>\Start Menu\Programs\Startup. So let me try thing..
 
Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData) will work for both operating systems.
 
How should i do that.. please se my edited codes.. thats what i have given for windows 7 ` private static readonly string StartupKey = @"C:\Users\name\AppData\Roaming\Microsoft\Windows\Start Menu\Programs\Startup\"; // this is in //windows 7 private static readonly string StartupValue = "foldercount - Shortcut"; private static void SetStartup() { //Set the application to run at startup RegistryKey key = Registry.CurrentUser.OpenSubKey(StartupKey, true); key.SetValue(StartupValue, Application.ExecutablePath.ToString()); }`
 
change StartupKey to Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData) this will store the correct path for XP or Win7 automatically
 
hi
what should i do
private static readonly string StartupKey = @"C:\Documents and Settings\stacy\Start Menu\Programs\Startup\";
private static readonly string StartupValue = "foldercount - Shortcut";


private static void SetStartup()
{
//Set the application to run at startup
RegistryKey key = Registry.CurrentUser.OpenSubKey(StartupKey, true);
key.SetValue(StartupValue, Application.ExecutablePath.ToString());
}
 
private static readonly string StartupKey = Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData);
this will make the path whatever it is supposed to be
you won't have to switch manually for the operating system
on my machine (Win7) this produces a StartupKey which is C:\Users\eddie_cat\AppData\Roaming
it's better than hardcoding
 
6:49 PM
private static readonly string StartupKey = Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData);
private static readonly string StartupValue = "foldercount - Shortcut";


private static void SetStartup()
{
//Set the application to run at startup
RegistryKey key = Registry.CurrentUser.OpenSubKey(StartupKey, true);
key.SetValue(StartupValue, Application.ExecutablePath.ToString());
}
is this correct now
 
yes it should work now
it was working before on win7 right?
 
so where i should copy my short cut
"foldercount - Shortcut"
in windows XP
 
i don't think you need to change anything else
 
i am runing this in a different machine... i am not switching betwwen windows 7 and windows XP in same machine.. i ma trying to run in a different
where there is no visual studio is installed
 
yes i know i was just making sure it was actually functioning on the win7 machine
i think that fixing this will solve your issues on XP
 
6:54 PM
so you mean my shortcut will automatically sopy to the registry...
copy
 
yes
should do the same thing on XP as it does on 7 now...
check the registry to see if it's doing what you expect
 

last day (15 days later) »