Click here to Skip to main content
15,886,199 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
Hello Experts

I had lots of search with many different search keys to find out my answer in Internet; but couldn't find any code to Start Windows (Not My Windows Application) at specified DateTime without enter windows password.

The only result of my searches is setting registry key to start windows automatically after windows shuts down(With entering no password too).
C#
class RegisteryWriter
{
    public static bool WriteDefaultLogin(string username, string password)
    {
        const string subKey = "SOFTWARE\\Microsoft\\Windows NT\\CurrentVersion\\Winlogon";

        RegistryKey registeryKey = Registry.LocalMachine.CreateSubKey(subKey);

        if (registeryKey == null)
            return false;
        else
        {
            registeryKey.SetValue("AutoAdminLogon", "1");
            registeryKey.SetValue("DefaultUserName", username);
            registeryKey.SetValue("DefaultPassword", password);
            registeryKey.Close();
            return true;
        }
            
    }

    public static bool RemoveDefaultLogin()
   {
       const string subKey = "SOFTWARE\\Microsoft\\Windows NT\\CurrentVersion\\Winlogon";

       RegistryKey registeryKey = Registry.LocalMachine.CreateSubKey(subKey);

       if (registeryKey == null)
           return false;
       else
       {
           registeryKey.DeleteValue("DefaultUserName", false);
           registeryKey.DeleteValue("DefaultPassword", false);
           registeryKey.DeleteValue("AutoAdminLogon", false);
           registeryKey.Close();
           return true;
       }
    }
}


Please help me with your patience.
I will be thankful of your help.

Good Luck
Posted
Updated 25-May-13 22:36pm
v2
Comments
tumbledDown2earth 26-May-13 4:34am    
you forgot your poser switch :P
Meysam Toluie 26-May-13 4:37am    
I forgot what?

And how do you think that is going to work?

When windows shuts down, it turns off the power to the processor, so no software is running.

If no software is running, it cannot check the time, or read the registry

If software can't check the time or read the registry, it can't start the system....


Which is why you couldn't find anything on the net to start a computer from your software: it can't be done.
 
Share this answer
 
Comments
Meysam Toluie 26-May-13 4:52am    
I do not want to use these typical ways that you named. As Windows can do this so I want to find a way to access the windows setting. I will find it some how. I just want help to do it as soon as possible! So what do you think now?
Meysam Toluie 28-May-13 2:55am    
I have already found a class named "Win32_ScheduledJob" but I couldn't use it. can this class help me?
http://msdn.microsoft.com/en-us/library/windows/desktop/aa394399(v=vs.85).aspx
You need to use another computer which can manage power to the parent computer. You have to trigger and event to the smps of the parent computer and start it up.

Even then you would need a pulse trigger mother board circuit

This is the most you can do I guess...
 
Share this answer
 
Comments
Meysam Toluie 28-May-13 2:53am    
I have already found a class named "Win32_ScheduledJob" but I couldn't use it. can this class help me?
http://msdn.microsoft.com/en-us/library/windows/desktop/aa394399(v=vs.85).aspx

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900