Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

shell & explorer.exe

Posted on 2000-03-26
8
Medium Priority
?
539 Views
Last Modified: 2010-08-05
I'm creating a program to limit the time my younger siblings spend each day on my computer.
I've created a login screen, and then I changed the SYSTEM.INI file so that "Shell" points to this
program.  This works fine, but when the correct password is entered, I want the program to run explorer.exe as a
shell.  Right now when I run explorer.exe, he just pops up like Windows Explorer, i.e no taskbar/startmenu & desktop visible.

Is it possible to run explorer.exe as a shell from within my program?


Another question,  I know that you can disable various things, like the desktop, control panel and start menu to
name a few ...  I've seen some tweak utility that did this.  How is this done?  It's somewhere in the registry, right?


Thanks,

Hagur
0
Comment
Question by:hagur
  • 2
  • 2
  • 2
  • +2
8 Comments
 
LVL 21

Expert Comment

by:gemarti
ID: 2658426
Why don't you use user profiles instead of trying to recreate the wheel? I mean with user profiles you can set windows up so that whoever is logged on only sees what you want them to see. Then if you want to also have a timer program that will shut down windows after a certain period of time you can create this program with the appropriate code and place it in the registry to run on startup for this specific user.

This would seem to be a easier solution.

0
 
LVL 15

Expert Comment

by:simonet
ID: 2658432
Once the default shell has been loaded, you cannot load (change) another shell.

Alex
0
 
LVL 10

Expert Comment

by:Lischke
ID: 2659975
My son is still too young to know what I'm actually doing on my computer but soon I have to care about this. And I already came to the conclusion that a simple DOS extension like Win9x doesn't provide the security I need. I know it is cheaper than OSes like WinNT but you will never need to think again about usual security with the latter. This might also be important if your machine is connected to Internet, as my little home network. I have two machines both running W2K and I simply cannot afford to open holes in my privacy (not only what my son sees, this would only be a small part of the problem, but what others may see).

Just my $0.02 and not thought as answer to this question here :-)

Ciao, Mike
0
Concerto's Cloud Advisory Services

Want to avoid the missteps to gaining all the benefits of the cloud? Learn more about the different assessment options from our Cloud Advisory team.

 
LVL 20

Expert Comment

by:Madshi
ID: 2660249
Just change the Shell setting back to "Explorer.Exe" before starting the explorer.

  WritePrivateProfileString(...);  // restore Explorer as cache
  WritePrivateProfileString(nil, nil, nil, ...);  // flush ini
  ShellExecute(...);  // start explorer

Most policies are under "HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Policies". The best way to find the correct keys is to use PolEdit and then look at the registry in the Policies key.

Regards, Madshi.
0
 
LVL 3

Author Comment

by:hagur
ID: 2660307
That's interesting Madshi ...

WritePrivateProfileString() where ?
In the registry?

Could you please be a little more specific?
0
 
LVL 21

Expert Comment

by:gemarti
ID: 2661639
Here's the syntax for WritePrivateProfileString()

WritePrivateProfileString(
  lpAppName:PChar;     {pointer to section name}
  lpKeyName:PChar;     {pointer to key name}
  lpString:PChar;      {pointer to string}
  lpFileName:PChar;    {pointer to initialization filename}
);BOOL;                {Returns TRUE or FALSE}

This function sets the string value for the specified reistry key in the specified section of a private user defined initialization file. The function can also create sections inside the initialization file.


I think you still need to setup the user profiles as I suggested, otherwise you will find nothing in the KEY that Madshi suggests.
0
 
LVL 20

Accepted Solution

by:
Madshi earned 400 total points
ID: 2661898
Hagur, you said this:

>> I've created a login screen, and then I changed the SYSTEM.INI file so that "Shell" points to this
program.

So I thought you would know how to use WritePrivateProfileString...   :-)

  WritePrivateProfileString('Boot', 'Shell', 'Explorer.Exe', 'system.ini');
  WritePrivateProfileString(nil, nil, nil, 'system.ini');

Regards, Madshi.

P.S: I don't have user profiles on my machine. It works without, too.
0
 
LVL 3

Author Comment

by:hagur
ID: 2663592
I'll have to accept Madshi's answer, what he said works exactly like I needed it to,  also without user profiles.

0

Featured Post

New feature and membership benefit!

New feature! Upgrade and increase expert visibility of your issues with Priority Questions.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

The uses clause is one of those things that just tends to grow and grow. Most of the time this is in the main form, as it's from this form that all others are called. If you have a big application (including many forms), the uses clause in the in…
Hello everybody This Article will show you how to validate number with TEdit control, What's the TEdit control? TEdit is a standard Windows edit control on a form, it allows to user to write, read and copy/paste single line of text. Usua…
Video by: ITPro.TV
In this episode Don builds upon the troubleshooting techniques by demonstrating how to properly monitor a vSphere deployment to detect problems before they occur. He begins the show using tools found within the vSphere suite as ends the show demonst…
This video shows how to quickly and easily deploy an email signature for all users in Office 365 and prevent it from being added to replies and forwards. (the resulting signature is applied on the server level in Exchange Online) The email signat…
Suggested Courses

971 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question