Click here to Skip to main content
Licence Ms-PL
First Posted 3 Jan 2006
Views 45,418
Downloads 399
Bookmarked 38 times

Startup Edit

By | 15 Apr 2010 | Article
This fully working program enables you to control what should and should not load automatically with Windows.

the options dialog

the edit dialog

Introduction

What is Startup Edit

Startup Edit is a small program that might come in handy when it comes to:

  1. Preventing (spyware) programs from running behind your back without your knowledge.
  2. Maximizing your system resources by removing unwanted programs from starting with Windows.
  3. Decreasing the time taken by Windows to load.

Why is it useful

This fully working program enables you to control what should and should not load automatically with Windows. This way, you eliminate viruses, worms, and spyware threats which might take advantage of this feature. It loads itself every time you start your PC and starts recording activities (loggers, spyware), or looks for anything that destroys your valuable data (viruses).

Problems solved

If you:

  1. Fully understand what should and should not load with Windows
  2. Have the "Startup Edit" right in Your desktop

you will no longer need many of the privacy protector software out there.

Latest news

Startup Edit now supports the msconfig.exe utility by reading its disabled items and givinge the user the ability to re-enable it or delete it forever!! In the near future, Startup Edit will support the plug-in technology.

Background

Have you ever asked yourself how programs like Yahoo! Messenger, MSN, ICQ etc.. load every time Windows starts up? Normally, when a program needs to load every time Windows starts up, it uses one of two techniques. The first technique is using the Windows Registry, which is the most common way nowadays. The second technique is using the famous Windows Startup folder. We will discuss the two techniques quickly.

The first technique, using the Windows Registry: I will not discuss the Windows Registry itself. A program can write to the Registry in one of two keys: The first key, "HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\" holds three sub keys (Run, RunOnce, RunOnceEx), and used when the program has to be loaded globally (in all user accounts). The second key, "HKEY_CURRENT_USER\SOFTWARE\Microsoft\Windows\CurrentVersion\" holds two sub keys (Run, RunOnce), and is used when the program has to be loaded locally (just in this user account).

  • Run - Means load the program every time Windows starts.
  • RunOnce - Means load the program just the next time Windows starts, and then Windows automatically deletes the entry.
  • RunOnceEx - Not used except for the first time ever Windows starts (starts after the installation of Windows itself).

The second technique uses the Startup Folder: This is the old fashioned way to load programs and it is rarely used now (Microsoft Office still uses it). This folder is found in the "Documents and Settings" folder; each user account has one folder named after his user name. There is one common startup folder found in the "All Users" folder under "Documents and Setting\All Users\Start Menu\Programs\Startup" to load a program in all user accounts.

A Note: Windows NT has a feature called "services" which is an application type that runs in the background, and is similar to UNIX daemon applications. Service applications are typically client/server applications, Web Servers, database servers, and other server-based applications for users, both locally and across a network. And usually, they don't have a visible user interface, and most services start up automatically with Windows and do their job. This feature is not yet supported, but I might support it in the near future.

Program features

  1. Lists all entries found in the following Registry keys:
    HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Run
    HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\RunOnce
    HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\RunOnceEx
    HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\RunServices (Win9x)
    HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\RunServicesOnce (Win9x)
    HKEY_CURRENT_USER\SOFTWARE\Microsoft\Windows\CurrentVersion\Run
    HKEY_CURRENT_USER\SOFTWARE\Microsoft\Windows\CurrentVersion\RunOnce
  2. Lists all entries found in the following folders:
    %SYSTEMDRIVE%\Documents and Settings\All Users\Start Menu\Programs\Startup
    %SYSTEMDRIVE%\Documents and Settings\YOUR_USER_NAME\Start Menu\Programs\Startup
  3. Enables you to remove any entry found in the list.
  4. Enables you to disable\enable any entry found in the list.
  5. Enables you to add\edit any entry to the list except to (Startup Folders).
  6. Enables you to launch and explore a folder or invoke its properties.
  7. Can differentiate between Win9x and WinNT, in general.
  8. Friendly user interface, easy to use.

The code: A closer look

Startup Edit has four forms: the Main form, the Edit form, the INI Editor form, and the Shutdown form.

Th method below removes any -, /, or , from the end of a string:

public string AnalyzeIt ( string MyString )
{ 
    if ( MyString.StartsWith ( "RUNDLL32.EXE" ) || 
         MyString.StartsWith ( "rundll32.exe" ) )
    { 
        MyString = MyString.Remove (0, 12); 
    }

    MyString.Trim();
    int MyLenght = MyString.Length; 
    char[] cSlaHyp = {'-','/', '"',','}; 
    int iSlaHyp = 0;

    if ( MyString.StartsWith ( "\"" ) )
    {
        MyString = MyString.Substring ( 1 );
        MyString.Trim();
    }
    iSlaHyp = MyString.LastIndexOfAny ( cSlaHyp );

    if ( iSlaHyp > -1 )
    {
        MyString = MyString.Substring ( 0, iSlaHyp );
        MyString.Trim();
        MyString = AnalyzeIt ( MyString );
        MyString.Trim();
    }

    return MyString;
}

That's it!

I'm very open to any criticism, comments, suggestions, ideas, or thoughts for improvements. So don't hesitate if any comes to your mind.

To-do list

  1. Code enhancements
  2. Versioning the release
  3. More useful utilities

History

  • 3 Jan 2006: First upload.
  • 4 Jan 2006: A complete rewrite to the program, and I have added a new module.
  • 5 Jan 2006: Changed the screenshot and fixed spelling and grammar errors.
  • 15 Feb 2006: New version released.
  • 16 Feb 2006: StartUp Edit Version 0.1 alpha released.
  • 22 Feb 2006: StartUp Edit Version 0.2 alpha released.
  • 15 Apr 2010: StartUp Edit Version 0.2 beta released.

License

This article, along with any associated source code and files, is licensed under The Microsoft Public License (Ms-PL)

About the Author

Ahmad Mahmoud [candseeme]

Architect
YFA Corp
Egypt Egypt

Member

Ahmad Mahmoud Cairo-Egypt
Deveoleping Windows Applications And Web Applications Using
C, C++, Visual C++ C#.Net & Asp.Net
And his Initial go Was With VB6
Now he's in To Java (Moving Merging...)
 
I learend a lot of stuff in CodeProject
you people are amazing
Good for you....
Thanks

Sign Up to vote   Poor Excellent
Add a reason or comment to your vote: x
Votes of 3 or less require a comment

Comments and Discussions

 
You must Sign In to use this message board. (secure sign-in)
 
Search this forum  
 FAQ
    Noise  Layout  Per page   
  Refresh
GeneralSysinternals is more comprehensive PinmemberJohn Brett5:38 15 Apr '10  
GeneralRe: Sysinternals is more comprehensive PinmemberAhmad Mahmoud [candseeme]23:46 17 Apr '10  
GeneralRe: Sysinternals is more comprehensive PinmemberJohn Brett22:36 18 Apr '10  
GeneralRe: Sysinternals is more comprehensive PinmemberAhmad Mahmoud [candseeme]2:22 19 Apr '10  
Generalthank you PinmemberHasbi Allah5:34 10 Feb '08  
GeneralRe: thank you PinmemberAhmad Mahmoud [candseeme]1:05 21 Jul '08  
GeneralUnstable PinmemberCliffStanford1:16 14 Jan '07  
QuestionRe: Unstable PinmemberCandseeme10:12 14 Jan '07  
AnswerRe: Unstable PinmemberCliffStanford2:38 15 Jan '07  
Generalto wish Pinmemberhelpsoft.ru1:16 23 Feb '06  
GeneralRe: to wish PinmemberCandseeme4:53 24 Feb '06  
QuestionWhat's wrong with msconfig? Pinmembernadav742:48 3 Jan '06  
AnswerRe: What's wrong with msconfig? PinmemberHal Angseesing6:23 3 Jan '06  
AnswerRe: What's wrong with msconfig? PinmemberCandseeme10:03 3 Jan '06  
AnswerRe: What's wrong with msconfig? Pinmember[Marc]15:15 15 Feb '06  
Answer[Message Removed] PinmemberMojtaba Vali9:24 22 Feb '06  

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.

Permalink | Advertise | Privacy | Mobile
Web01 | 2.5.120517.1 | Last Updated 15 Apr 2010
Article Copyright 2006 by Ahmad Mahmoud [candseeme]
Everything else Copyright © CodeProject, 1999-2012
Terms of Use
Layout: fixed | fluid