Click here to Skip to main content
6,630,901 members and growing! (19,251 online)
Email Password   helpLost your password?
Languages » C# » General     Intermediate License: The Microsoft Public License (Ms-PL)

Startup Edit

By Ahmad Mahmoud [candseeme]

This fully working program enables you to control what should and should not load automatically with windows
C#.NET 1.1, Win2K, WinXPVS.NET2003, CEO, Dev
Posted:3 Jan 2006
Updated:22 Feb 2006
Views:36,118
Bookmarked:32 times
Unedited contribution
Announcements
Loading...
 
Search    
Advanced Search
Add to IE Search
printPrint   add Share
      Discuss Discuss   Broken Article?Report  
43 votes for this article.
Popularity: 5.38 Rating: 3.29 out of 5
6 votes, 14.0%
1
2 votes, 4.7%
2
4 votes, 9.3%
3
7 votes, 16.3%
4
24 votes, 55.8%
5

Main window

the options dialog

I'm very open to any criticism, comments, suggestions, ideas or thoughts of improvements

So don't hesitate if any comes to your mind.

Latest News

Startup Edit now support the msconfig.exe utility by reading its disabled items and give the user the ability to re-enable it or delete it forever!!

in the near future Startup Edit will Support the Plugin Technology.

 

Introduction

What is Startup Edit ! ?:

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

1) Preventing (spys, spyware) programs from running behind your back without your knowledge. 

2) Maximizing your system resources by removing the unneeded programs from starting with windows

3) decreasing the time taken by windows to load.

Why It is useful ! ?

This fully working program enables you to control  what should and should not load automatically with windows

By this way you eliminate many viruses , worms and spyware threats. which might take advantage of this feature.

And loads itself every time you start your pc and start recording your activities (loggers) , call home ( spyware), or destroy your valuable data ( Viruses ).

Problems Solved:

No doubt 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 protectors software out there

Background

Have you ever asked yourself how programs like ( Yahoo!, MSN, ICQ etc.. ) loads everytime windows starts up.

Normally when a program needs to load everytime windows starts up, this program uses one of two techniques

The first technique is : The Windows Registry which is most common way nowadays

The second technique is : The Famous Windows Startup Folder

We will discuss the two techniques in hurry.


The first technique "The Windows Registry" :

I will not discuss the window registry itself but if you want more info i'll post soon some links.

So Let's Cut the ice

  a program writes to the registry in one of two keys

First Key "HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\"

which usually holds three sub keys ( Run, RunOnce, RunOnceEx ) and here the program will Load  globally ( in all user accounts )

Second Key "HKEY_CURRENT_USER\SOFTWARE\Microsoft\Windows\CurrentVersion\"

and it usually hold two sub keys ( Run, RunOnce ) And Here The Program will Load locally ( Just in this user account )

Run -> Means Load This Program Every Time Windows start

RunOnce -> Means Load This Program JUST The Next Time Windows Starts then Windows Automatically Deletes The Entry

RunOnceEx -> Not Used Except for the first time ever windows starts ( its initial start after the installation of windows itself )


The second technique " Startup Folder":

This is the old fashioned way to load programs it is currently rarely used ( Microsoft Office Still Uses it )

Well in brief this folder found in "Documents and Settings" Folder Each User Account has one folder named after his user name

And their is one common startup folder found in the "All Users" Folder under "Documents and Setting\All Users\Start Menu\Programs\Startup" to load in all users accounts

A Note

Windows NT in general has  a feature called "services"  which is ;

an application type that runs in the background and is similar to UNIX daemon applications. Service applications typically provide features such as client/server applications, Web servers, database servers, and other server-based applications to users, both locally and across the network.(

and usually they don't have a visible user interface and most of services starts up automatically with windows and done its 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 fntry found in the list.

6) Enables you to add\edit any entry to the list expect to (Startup Folders ).

7) Enables you to launch, explore its folder or invoke its properties.

8) Smart can differ betwen win9x and winnt in general.

8) Friendly user interface, easy to use.

The Code "a Closer Look"

Well Startup Edit has four forms ( the Main Form, the Edit Form, the INI Editor Form and the Shutdown Form

here's some code snippest

this method removes any -,/ or , from the end of the 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;

}

To Do List

1) doing some code enhancement

2) versioning the release

3) Doing some 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 some spell check and grammer

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

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]


Member
Ahmad Mahmoud Cairo-Egypt
Deveoleping Windows Applications And Web Applications Using
C, C++, Visual C++ C#.Net & Asp.Net
And My Initial Start Was With VB6
Now i'm in To Java (Moving Merging...)

I learend a lot of stuff in CodeProject
you people are amazing
Good for you....
Thanks
Occupation: Architect
Company: YFA Corp
Location: Egypt Egypt

Other popular C# articles:

Article Top
You must Sign In to use this message board.
FAQ FAQ 
 
Noise Tolerance  Layout  Per page   
 Msgs 1 to 12 of 12 (Total in Forum: 12) (Refresh)FirstPrevNext
Generalthank you PinmemberHasbi Allah6:34 10 Feb '08  
GeneralRe: thank you PinmemberAhmad Mahmoud [candseeme]2:05 21 Jul '08  
GeneralUnstable PinmemberCliffStanford2:16 14 Jan '07  
QuestionRe: Unstable PinmemberCandseeme11:12 14 Jan '07  
AnswerRe: Unstable PinmemberCliffStanford3:38 15 Jan '07  
Generalto wish Pinmemberhelpsoft.ru2:16 23 Feb '06  
GeneralRe: to wish PinmemberCandseeme5:53 24 Feb '06  
QuestionWhat's wrong with msconfig? Pinmembernadav743:48 3 Jan '06  
AnswerRe: What's wrong with msconfig? PinmemberHal Angseesing7:23 3 Jan '06  
AnswerRe: What's wrong with msconfig? PinmemberCandseeme11:03 3 Jan '06  
AnswerRe: What's wrong with msconfig? Pinmember[Marc]16:15 15 Feb '06  
Answer[Message Removed] PinmemberMojtaba Vali10:24 22 Feb '06  

General General    News News    Question Question    Answer Answer    Joke Joke    Rant Rant    Admin Admin   

PermaLink | Privacy | Terms of Use
Last Updated: 22 Feb 2006
Editor:
Copyright 2006 by Ahmad Mahmoud [candseeme]
Everything else Copyright © CodeProject, 1999-2009
Web22 | Advertise on the Code Project