Changing windows shell?

[b][red]This message was edited by mrsmiley0221 at 2004-8-18 6:57:26[/red][/b][hr]
Hi everyone, i've got a little bit of a problem i was hoping you all could help me with.

I've created an database management program for my company but the users here like to do things that they're not supposed to be doing (i.e.- reading personal e-mail,downloading AIM, collecting viruses like a magnet..) so, management has come to me to get them to stop :(

basically, i need to keep them from doing anything except the things that i give them permission to do...here's what i was thinking, it should give you all an idea of what i need to do.

i've created a separate program that i call the "Portal" from here, either with menu's or buttons, the user can do everything that they need to do...launch the database program i created (which has a form for Internet access with a menu of available sites and no address bar, so they don't need IE)..they can open word/excel from the portal as well. This is all working properly but as it is all set up now, they can still use ctrl+alt+delete, they can still get to the desktop and the start menu to open anything they want...this is no good!

i've done some searching and i found a couple of programs that basically do what i need but not exactly. i came across a program called FreshUI which will enable me to set a program as the windows shell instead of explorer.exe. i used this to set the portal as the shell and that accomplishes what i need except that i'd really like to try and accomplish this without using third-party software.

Also, when FreshUI changes the shell, windows needs to be re-started before the changes can take effect...is this standard when changing the shell? ideally, i'm looking for a way to change the shell at runtime without having to re-start. i created a small "PortalKey" program which i store on a usb data storage keychain. with successful login, a few Tech-Only buttons/menus appear on the portal (this is working). from one of those menus, i'd like to be able to "Unlock" the portal so that i can access Windows,taskmanager etc..

if it's not possible to change the windows shell without re-starting, i'm open to suggestions on how to accomplish the same security without changing the shell...for example, if i could completely disable the desktop/startbar and system commands (ctrl+alt+delete,alt+f4,ctrl+esc, and windows key).

Any and all help would be greatly appreciated, thanks everyone!

-Ryan


EDIT: Forgot to mention that i'm using VB6

Comments

  • [b][red]This message was edited by infidel at 2004-8-18 7:45:53[/red][/b][hr]
    : [b][red]This message was edited by mrsmiley0221 at 2004-8-18 6:57:26[/red][/b][hr]
    : Hi everyone, i've got a little bit of a problem i was hoping you all could help me with.
    :
    : I've created an database management program for my company but the users here like to do things that they're not supposed to be doing (i.e.- reading personal e-mail,downloading AIM, collecting viruses like a magnet..) so, management has come to me to get them to stop :(
    :
    : basically, i need to keep them from doing anything except the things that i give them permission to do...here's what i was thinking, it should give you all an idea of what i need to do.
    :
    : i've created a separate program that i call the "Portal" from here, either with menu's or buttons, the user can do everything that they need to do...launch the database program i created (which has a form for Internet access with a menu of available sites and no address bar, so they don't need IE)..they can open word/excel from the portal as well. This is all working properly but as it is all set up now, they can still use ctrl+alt+delete, they can still get to the desktop and the start menu to open anything they want...this is no good!
    :
    : i've done some searching and i found a couple of programs that basically do what i need but not exactly. i came across a program called FreshUI which will enable me to set a program as the windows shell instead of explorer.exe. i used this to set the portal as the shell and that accomplishes what i need except that i'd really like to try and accomplish this without using third-party software.
    :
    : Also, when FreshUI changes the shell, windows needs to be re-started before the changes can take effect...is this standard when changing the shell? ideally, i'm looking for a way to change the shell at runtime without having to re-start. i created a small "PortalKey" program which i store on a usb data storage keychain. with successful login, a few Tech-Only buttons/menus appear on the portal (this is working). from one of those menus, i'd like to be able to "Unlock" the portal so that i can access Windows,taskmanager etc..
    :
    : if it's not possible to change the windows shell without re-starting, i'm open to suggestions on how to accomplish the same security without changing the shell...for example, if i could completely disable the desktop/startbar and system commands (ctrl+alt+delete,alt+f4,ctrl+esc, and windows key).
    :
    : Any and all help would be greatly appreciated, thanks everyone!
    :
    : -Ryan
    :
    :
    : EDIT: Forgot to mention that i'm using VB6

    The shell is chosen at startup time (in the config.sys file, I believe) so there really isn't any way to change shells without restarting. I don't know about disabling the magic keystrokes, but I'm sure someone does.

    If you're worried about downloads and viruses, couldn't you configure the firewall to only let the approved sites through?


    [size=5][italic][blue][RED]i[/RED]nfidel[/blue][/italic][/size]

    [code]
    $ select * from users where clue > 0
    no rows returned
    [/code]



  • : [b][red]This message was edited by infidel at 2004-8-18 7:45:53[/red][/b][hr]
    : : [b][red]This message was edited by mrsmiley0221 at 2004-8-18 6:57:26[/red][/b][hr]
    : : Hi everyone, i've got a little bit of a problem i was hoping you all could help me with.
    : :
    : : I've created an database management program for my company but the users here like to do things that they're not supposed to be doing (i.e.- reading personal e-mail,downloading AIM, collecting viruses like a magnet..) so, management has come to me to get them to stop :(
    : :
    : : basically, i need to keep them from doing anything except the things that i give them permission to do...here's what i was thinking, it should give you all an idea of what i need to do.
    : :
    : : i've created a separate program that i call the "Portal" from here, either with menu's or buttons, the user can do everything that they need to do...launch the database program i created (which has a form for Internet access with a menu of available sites and no address bar, so they don't need IE)..they can open word/excel from the portal as well. This is all working properly but as it is all set up now, they can still use ctrl+alt+delete, they can still get to the desktop and the start menu to open anything they want...this is no good!
    : :
    : : i've done some searching and i found a couple of programs that basically do what i need but not exactly. i came across a program called FreshUI which will enable me to set a program as the windows shell instead of explorer.exe. i used this to set the portal as the shell and that accomplishes what i need except that i'd really like to try and accomplish this without using third-party software.
    : :
    : : Also, when FreshUI changes the shell, windows needs to be re-started before the changes can take effect...is this standard when changing the shell? ideally, i'm looking for a way to change the shell at runtime without having to re-start. i created a small "PortalKey" program which i store on a usb data storage keychain. with successful login, a few Tech-Only buttons/menus appear on the portal (this is working). from one of those menus, i'd like to be able to "Unlock" the portal so that i can access Windows,taskmanager etc..
    : :
    : : if it's not possible to change the windows shell without re-starting, i'm open to suggestions on how to accomplish the same security without changing the shell...for example, if i could completely disable the desktop/startbar and system commands (ctrl+alt+delete,alt+f4,ctrl+esc, and windows key).
    : :
    : : Any and all help would be greatly appreciated, thanks everyone!
    : :
    : : -Ryan
    : :
    : :
    : : EDIT: Forgot to mention that i'm using VB6
    :
    : The shell is chosen at startup time (in the config.sys file, I believe) so there really isn't any way to change shells without restarting. I don't know about disabling the magic keystrokes, but I'm sure someone does.
    :
    : If you're worried about downloads and viruses, couldn't you configure the firewall to only let the approved sites through?
    :
    :
    : [size=5][italic][blue][RED]i[/RED]nfidel[/blue][/italic][/size]
    :
    : [code]
    : $ select * from users where clue > 0
    : no rows returned
    : [/code]
    :
    :
    :
    :
    Thanks for the quick reply! The downloads and viruses is only a small part of the problem...i do have internet monitoring software running on my computer. it enables me to allow users access to the internet, set time limits, etc. the problem with this is that the marginally computer savvy users have gotten into the habit of using ctrl+alt+delete to end the process that locks their internet.

    does anyone know if there's a way to do a "phantom startup"? what i mean by this, is something that basically re-loads everything that loads up at startup without having to restart? kinda like a ReloadRegistry API or something like that? if there's no such thing, i think it'd be a great update ;)

    i'd really like to disable/enable as many things as i can as quickly as possible...if someone has a problem with their computer, i'd like to be able to go there, unlock the portal, fix the problem, lock the portal back up and get back to work...with my setup now, i'd have to unlock the portal, restart the computer, fix the problem, re-activate the portal, then restart the computer again...just alot of wasted time that i'd love to avoid if i can.

    still taking suggestions on how to get a workaround for this...thanks again everyone!

    -Ryan
  • Well, looks like your in for a big challenge. Hope you live through it ;-)

    I just have a note to make (so you can tackle with it before anybody else using the 'portalled' computer finds this out). If you are running word, you might be able to use it to launch executables. One of these could be the Task Manager (Say bye-bye to your program). A user could probably achieve this by opening a file in word. Setting the file extension to All files (*.*), search for the EXE and run it... Seems like a neat way to override the security! (Or does your Shell changing also disable the Task Manager?)

    Greets...
    Richard

  • : Well, looks like your in for a big challenge. Hope you live through it ;-)
    :
    : I just have a note to make (so you can tackle with it before anybody else using the 'portalled' computer finds this out). If you are running word, you might be able to use it to launch executables. One of these could be the Task Manager (Say bye-bye to your program). A user could probably achieve this by opening a file in word. Setting the file extension to All files (*.*), search for the EXE and run it... Seems like a neat way to override the security! (Or does your Shell changing also disable the Task Manager?)
    :
    : Greets...
    : Richard
    :
    :
    Wow, nice...i hadn't even thought about that. if possible, i would like to disable the taskmanager but from what i've found so far leads me to believe that it's not a real easy thing to do? if not, i'll probably have to keep them from using Word also..i'm using Word automation to open and populate templates, i suppose i could fill a print menu with each doc they'd need then populate it and send to printer without making Word visible...thanks for the heads up!

    -Ryan
  • : : Well, looks like your in for a big challenge. Hope you live through it ;-)
    : :
    : : I just have a note to make (so you can tackle with it before anybody else using the 'portalled' computer finds this out). If you are running word, you might be able to use it to launch executables. One of these could be the Task Manager (Say bye-bye to your program). A user could probably achieve this by opening a file in word. Setting the file extension to All files (*.*), search for the EXE and run it... Seems like a neat way to override the security! (Or does your Shell changing also disable the Task Manager?)
    : :
    : : Greets...
    : : Richard
    : :
    : :
    : Wow, nice...i hadn't even thought about that. if possible, i would like to disable the taskmanager but from what i've found so far leads me to believe that it's not a real easy thing to do? if not, i'll probably have to keep them from using Word also..i'm using Word automation to open and populate templates, i suppose i could fill a print menu with each doc they'd need then populate it and send to printer without making Word visible...thanks for the heads up!
    :
    : -Ryan
    :

    Im not sure bout answering most of your Questions Ryan, but there is a program a school I used to work for used called Fortres. It would disable all functions, Cntrl+Alt+Del, disable start button, and disable many more unitilities from windows. So there is a capability to do it, but I Am not sure of the commands. Perhaps you may look into this software, I know you mentioned you did not wish to use third party software, but it might be worth it if it is not too expensive.

    The Darthmoob

  • [b][red]This message was edited by MicroDot at 2004-8-19 1:10:22[/red][/b][hr]
    [b][red]This message was edited by MicroDot at 2004-8-19 1:9:7[/red][/b][hr]
    Hi,
    You can change a registry value to disable/enable the task manager without restarting the computer.

    Hive
    ----
    HKEY_CURRENT_USERSoftwareMicrosoftWindowsCurrentVersionPoliciesSystem

    Key
    ---
    DisableTaskMgr

    Values
    ------
    1 = Disabled
    0 = Enabled


    Try this:
    Create a new project (Standard EXE)
    Add Windows Script Host Object Model (wshom.ocx) to your refrences

    [code]

    Option Explicit

    Private m_objWS As IWshRuntimeLibrary.WshShell
    Private m_blnDisabled As Boolean

    Private Const REG_HIVE = "HKEY_CURRENT_USERSoftwareMicrosoftWindowsCurrentVersionPoliciesSystem"
    Private Const REG_KEY = "DisableTaskMgr"
    Private Const REG_VALUE_DISABLE = 1
    Private Const REG_VALUE_ENABLE = 0

    Private Sub Form_Load()
    Set m_objWS = New IWshRuntimeLibrary.WshShell
    Call LoadSettings
    Call SetCaption
    End Sub

    Private Sub LoadSettings()

    On Error GoTo LS_Err

    m_blnDisabled = m_objWS.RegRead(REG_HIVE & REG_KEY)

    Exit Sub

    LS_Err:
    Call SetDefault
    End Sub

    Private Sub SetDefault()
    m_blnDisabled = True
    Call m_objWS.RegWrite(REG_HIVE & REG_KEY, CInt(m_blnDisabled))
    End Sub

    Private Sub SetCaption()
    If m_blnDisabled Then
    Command1.Caption = "Disable"
    Else
    Command1.Caption = "Enable"
    End If
    End Sub

    Private Sub Command1_Click()
    m_blnDisabled = Abs(m_blnDisabled) - 1
    Call m_objWS.RegWrite(REG_HIVE & REG_KEY, CInt(m_blnDisabled))
    Call SetCaption
    End Sub

    Private Sub Form_Unload(Cancel As Integer)
    Set m_objWS = Nothing
    End Sub

    [/code]


    [hr]

    [b][blue]//MicroDot[/blue][/b]





  • [b][red]This message was edited by mrsmiley0221 at 2004-8-19 6:44:11[/red][/b][hr]
    : [b][red]This message was edited by MicroDot at 2004-8-19 1:10:22[/red][/b][hr]
    : [b][red]This message was edited by MicroDot at 2004-8-19 1:9:7[/red][/b][hr]
    : Hi,
    : You can change a registry value to disable/enable the task manager without restarting the computer.
    :
    : Hive
    : ----
    : HKEY_CURRENT_USERSoftwareMicrosoftWindowsCurrentVersionPoliciesSystem
    :
    : Key
    : ---
    : DisableTaskMgr
    :
    : Values
    : ------
    : 1 = Disabled
    : 0 = Enabled
    :
    :
    : Try this:
    : Create a new project (Standard EXE)
    : Add Windows Script Host Object Model (wshom.ocx) to your refrences
    :
    : [code]
    :
    : Option Explicit
    :
    : Private m_objWS As IWshRuntimeLibrary.WshShell
    : Private m_blnDisabled As Boolean
    :
    : Private Const REG_HIVE = "HKEY_CURRENT_USERSoftwareMicrosoftWindowsCurrentVersionPoliciesSystem"
    : Private Const REG_KEY = "DisableTaskMgr"
    : Private Const REG_VALUE_DISABLE = 1
    : Private Const REG_VALUE_ENABLE = 0
    :
    : Private Sub Form_Load()
    : Set m_objWS = New IWshRuntimeLibrary.WshShell
    : Call LoadSettings
    : Call SetCaption
    : End Sub
    :
    : Private Sub LoadSettings()
    :
    : On Error GoTo LS_Err
    :
    : m_blnDisabled = m_objWS.RegRead(REG_HIVE & REG_KEY)
    :
    : Exit Sub
    :
    : LS_Err:
    : Call SetDefault
    : End Sub
    :
    : Private Sub SetDefault()
    : m_blnDisabled = True
    : Call m_objWS.RegWrite(REG_HIVE & REG_KEY, CInt(m_blnDisabled))
    : End Sub
    :
    : Private Sub SetCaption()
    : If m_blnDisabled Then
    : Command1.Caption = "Disable"
    : Else
    : Command1.Caption = "Enable"
    : End If
    : End Sub
    :
    : Private Sub Command1_Click()
    : m_blnDisabled = Abs(m_blnDisabled) - 1
    : Call m_objWS.RegWrite(REG_HIVE & REG_KEY, CInt(m_blnDisabled))
    : Call SetCaption
    : End Sub
    :
    : Private Sub Form_Unload(Cancel As Integer)
    : Set m_objWS = Nothing
    : End Sub
    :
    : [/code]
    :
    :
    : [hr]
    :
    : [b][blue]//MicroDot[/blue][/b]
    :
    :
    :

    Great, thanks MicroDot! that'll definately help...aside from being one of the things i need to do, it'll help me change the registry correctly...i played around a little bit using regedit but that almost caused a lot of wasted time. here's what i did, because i'd like to try and get some suggestions on how to keep it from happening again, as this is my first time really messing around with the registry at all...(i went into a bit more detail than i expected with my first real registry experience so if you don't want to read a story skip to the bottom) :)

    at www.regedit.com, they had alot of good tips and examples on how to do things...one was the RestrictRun key, which when created, should allow only the programs that i listed in the subkeys...apparently i did something wrong, because when i restarted my computer, NOTHING would run...if it had a .exe i couldn't get it to work. i'm not sure what i did wrong because i thought i was following the directions.

    i did have the forethought to backup the registry but what i didn't realize was that it was saved as a registry file that needs regedit.exe to run...so i couldn't use it! when i left work last night, i had resigned myself to reinstalling windows this morning...before i did that though, i figured i'd run the task manager and see if there's anything in there that'd help...since i was going to reinstall windows anyway i didn't think i could mess too much up by playing around...after a couple of minutes, i decided to try debugging the explorer...that opened up the debugger, so from there i tried opening regedit.exe (thanks BitByBit!)...and it worked! deleted the RestrictRun key/sub keys, restarted windows and everything is good :)

    BOTTOM:
    ok, so i'd like to keep from locking myself out of the registry, or atleast be able to make a backup of the registry that can be loaded without using any programs...if that's possible. any suggestions? i'm also still taking suggestions on what would be good keys to look at editing/creating for adding restrictions...also, if anyone knows the correct way to use RestrictRun, i could combine that with the taskmanager disabler and that should do everything i need.

    Thanks again everyone!

    -Ryan


  • [b][red]This message was edited by MicroDot at 2004-8-20 0:55:48[/red][/b][hr]
    : [b][red]This message was edited by mrsmiley0221 at 2004-8-19 6:44:11[/red][/b][hr]
    : : [b][red]This message was edited by MicroDot at 2004-8-19 1:10:22[/red][/b][hr]
    : : [b][red]This message was edited by MicroDot at 2004-8-19 1:9:7[/red][/b][hr]
    : : Hi,
    : : You can change a registry value to disable/enable the task manager without restarting the computer.
    : :
    : : Hive
    : : ----
    : : HKEY_CURRENT_USERSoftwareMicrosoftWindowsCurrentVersionPoliciesSystem
    : :
    : : Key
    : : ---
    : : DisableTaskMgr
    : :
    : : Values
    : : ------
    : : 1 = Disabled
    : : 0 = Enabled
    : :
    : :
    : : Try this:
    : : Create a new project (Standard EXE)
    : : Add Windows Script Host Object Model (wshom.ocx) to your refrences
    : :
    : : [code]
    : :
    : : Option Explicit
    : :
    : : Private m_objWS As IWshRuntimeLibrary.WshShell
    : : Private m_blnDisabled As Boolean
    : :
    : : Private Const REG_HIVE = "HKEY_CURRENT_USERSoftwareMicrosoftWindowsCurrentVersionPoliciesSystem"
    : : Private Const REG_KEY = "DisableTaskMgr"
    : : Private Const REG_VALUE_DISABLE = 1
    : : Private Const REG_VALUE_ENABLE = 0
    : :
    : : Private Sub Form_Load()
    : : Set m_objWS = New IWshRuntimeLibrary.WshShell
    : : Call LoadSettings
    : : Call SetCaption
    : : End Sub
    : :
    : : Private Sub LoadSettings()
    : :
    : : On Error GoTo LS_Err
    : :
    : : m_blnDisabled = m_objWS.RegRead(REG_HIVE & REG_KEY)
    : :
    : : Exit Sub
    : :
    : : LS_Err:
    : : Call SetDefault
    : : End Sub
    : :
    : : Private Sub SetDefault()
    : : m_blnDisabled = True
    : : Call m_objWS.RegWrite(REG_HIVE & REG_KEY, CInt(m_blnDisabled))
    : : End Sub
    : :
    : : Private Sub SetCaption()
    : : If m_blnDisabled Then
    : : Command1.Caption = "Disable"
    : : Else
    : : Command1.Caption = "Enable"
    : : End If
    : : End Sub
    : :
    : : Private Sub Command1_Click()
    : : m_blnDisabled = Abs(m_blnDisabled) - 1
    : : Call m_objWS.RegWrite(REG_HIVE & REG_KEY, CInt(m_blnDisabled))
    : : Call SetCaption
    : : End Sub
    : :
    : : Private Sub Form_Unload(Cancel As Integer)
    : : Set m_objWS = Nothing
    : : End Sub
    : :
    : : [/code]
    : :
    : :
    : : [hr]
    : :
    : : [b][blue]//MicroDot[/blue][/b]
    : :
    : :
    : :
    :
    : Great, thanks MicroDot! that'll definately help...aside from being one of the things i need to do, it'll help me change the registry correctly...i played around a little bit using regedit but that almost caused a lot of wasted time. here's what i did, because i'd like to try and get some suggestions on how to keep it from happening again, as this is my first time really messing around with the registry at all...(i went into a bit more detail than i expected with my first real registry experience so if you don't want to read a story skip to the bottom) :)
    :
    : at www.regedit.com, they had alot of good tips and examples on how to do things...one was the RestrictRun key, which when created, should allow only the programs that i listed in the subkeys...apparently i did something wrong, because when i restarted my computer, NOTHING would run...if it had a .exe i couldn't get it to work. i'm not sure what i did wrong because i thought i was following the directions.
    :
    : i did have the forethought to backup the registry but what i didn't realize was that it was saved as a registry file that needs regedit.exe to run...so i couldn't use it! when i left work last night, i had resigned myself to reinstalling windows this morning...before i did that though, i figured i'd run the task manager and see if there's anything in there that'd help...since i was going to reinstall windows anyway i didn't think i could mess too much up by playing around...after a couple of minutes, i decided to try debugging the explorer...that opened up the debugger, so from there i tried opening regedit.exe (thanks BitByBit!)...and it worked! deleted the RestrictRun key/sub keys, restarted windows and everything is good :)
    :
    : BOTTOM:
    : ok, so i'd like to keep from locking myself out of the registry, or atleast be able to make a backup of the registry that can be loaded without using any programs...if that's possible. any suggestions? i'm also still taking suggestions on what would be good keys to look at editing/creating for adding restrictions...also, if anyone knows the correct way to use RestrictRun, i could combine that with the taskmanager disabler and that should do everything i need.
    :
    : Thanks again everyone!
    :
    : -Ryan
    :
    :
    :

    Hi Ryan,
    I looked at the following topic at www.regedit.com:
    http://www.winguides.com/registry/display.php/113/

    As it sas in at the page you should change the registry settings for another user, create a temporary local account to play around with, so you can change back the settings in the registry with your default account.

    Create following with regedit when logged on with the temporary account:
    *******************************
    Hive:
    HKEY_CURRENT_USERSoftwareMicrosoftWindowsCurrentVersion PoliciesExplorer

    Key:
    RestrictRun = 1
    *******************************
    Hive:
    HKEY_CURRENT_USERSoftwareMicrosoftWindowsCurrentVersion PoliciesExplorerRestrictRun

    Keys:
    1 = regedit.exe
    2 = notepad.exe
    .... List the applications you want the user to be able to run.
    *******************************

    Change the RestrictRun key to 0 if you want to disable the feature.
    You have to reboot the computer each time you change anything though.

    This should be easy to implement in your app, either use IWshRuntimeLibrary.WshShell or do it with the Windows API.

    Cheers!

    [hr]

    [b][blue]//MicroDot[/blue][/b]



  • : [b][red]This message was edited by MicroDot at 2004-8-20 0:55:48[/red][/b][hr]
    : : [b][red]This message was edited by mrsmiley0221 at 2004-8-19 6:44:11[/red][/b][hr]
    : : : [b][red]This message was edited by MicroDot at 2004-8-19 1:10:22[/red][/b][hr]
    : : : [b][red]This message was edited by MicroDot at 2004-8-19 1:9:7[/red][/b][hr]
    : : : Hi,
    : : : You can change a registry value to disable/enable the task manager without restarting the computer.
    : : :
    : : : Hive
    : : : ----
    : : : HKEY_CURRENT_USERSoftwareMicrosoftWindowsCurrentVersionPoliciesSystem
    : : :
    : : : Key
    : : : ---
    : : : DisableTaskMgr
    : : :
    : : : Values
    : : : ------
    : : : 1 = Disabled
    : : : 0 = Enabled
    : : :
    : : :
    : : : Try this:
    : : : Create a new project (Standard EXE)
    : : : Add Windows Script Host Object Model (wshom.ocx) to your refrences
    : : :
    : : : [code]
    : : :
    : : : Option Explicit
    : : :
    : : : Private m_objWS As IWshRuntimeLibrary.WshShell
    : : : Private m_blnDisabled As Boolean
    : : :
    : : : Private Const REG_HIVE = "HKEY_CURRENT_USERSoftwareMicrosoftWindowsCurrentVersionPoliciesSystem"
    : : : Private Const REG_KEY = "DisableTaskMgr"
    : : : Private Const REG_VALUE_DISABLE = 1
    : : : Private Const REG_VALUE_ENABLE = 0
    : : :
    : : : Private Sub Form_Load()
    : : : Set m_objWS = New IWshRuntimeLibrary.WshShell
    : : : Call LoadSettings
    : : : Call SetCaption
    : : : End Sub
    : : :
    : : : Private Sub LoadSettings()
    : : :
    : : : On Error GoTo LS_Err
    : : :
    : : : m_blnDisabled = m_objWS.RegRead(REG_HIVE & REG_KEY)
    : : :
    : : : Exit Sub
    : : :
    : : : LS_Err:
    : : : Call SetDefault
    : : : End Sub
    : : :
    : : : Private Sub SetDefault()
    : : : m_blnDisabled = True
    : : : Call m_objWS.RegWrite(REG_HIVE & REG_KEY, CInt(m_blnDisabled))
    : : : End Sub
    : : :
    : : : Private Sub SetCaption()
    : : : If m_blnDisabled Then
    : : : Command1.Caption = "Disable"
    : : : Else
    : : : Command1.Caption = "Enable"
    : : : End If
    : : : End Sub
    : : :
    : : : Private Sub Command1_Click()
    : : : m_blnDisabled = Abs(m_blnDisabled) - 1
    : : : Call m_objWS.RegWrite(REG_HIVE & REG_KEY, CInt(m_blnDisabled))
    : : : Call SetCaption
    : : : End Sub
    : : :
    : : : Private Sub Form_Unload(Cancel As Integer)
    : : : Set m_objWS = Nothing
    : : : End Sub
    : : :
    : : : [/code]
    : : :
    : : :
    : : : [hr]
    : : :
    : : : [b][blue]//MicroDot[/blue][/b]
    : : :
    : : :
    : : :
    : :
    : : Great, thanks MicroDot! that'll definately help...aside from being one of the things i need to do, it'll help me change the registry correctly...i played around a little bit using regedit but that almost caused a lot of wasted time. here's what i did, because i'd like to try and get some suggestions on how to keep it from happening again, as this is my first time really messing around with the registry at all...(i went into a bit more detail than i expected with my first real registry experience so if you don't want to read a story skip to the bottom) :)
    : :
    : : at www.regedit.com, they had alot of good tips and examples on how to do things...one was the RestrictRun key, which when created, should allow only the programs that i listed in the subkeys...apparently i did something wrong, because when i restarted my computer, NOTHING would run...if it had a .exe i couldn't get it to work. i'm not sure what i did wrong because i thought i was following the directions.
    : :
    : : i did have the forethought to backup the registry but what i didn't realize was that it was saved as a registry file that needs regedit.exe to run...so i couldn't use it! when i left work last night, i had resigned myself to reinstalling windows this morning...before i did that though, i figured i'd run the task manager and see if there's anything in there that'd help...since i was going to reinstall windows anyway i didn't think i could mess too much up by playing around...after a couple of minutes, i decided to try debugging the explorer...that opened up the debugger, so from there i tried opening regedit.exe (thanks BitByBit!)...and it worked! deleted the RestrictRun key/sub keys, restarted windows and everything is good :)
    : :
    : : BOTTOM:
    : : ok, so i'd like to keep from locking myself out of the registry, or atleast be able to make a backup of the registry that can be loaded without using any programs...if that's possible. any suggestions? i'm also still taking suggestions on what would be good keys to look at editing/creating for adding restrictions...also, if anyone knows the correct way to use RestrictRun, i could combine that with the taskmanager disabler and that should do everything i need.
    : :
    : : Thanks again everyone!
    : :
    : : -Ryan
    : :
    : :
    : :
    :
    : Hi Ryan,
    : I looked at the following topic at www.regedit.com:
    : http://www.winguides.com/registry/display.php/113/
    :
    : As it sas in at the page you should change the registry settings for another user, create a temporary local account to play around with, so you can change back the settings in the registry with your default account.
    :
    : Create following with regedit when logged on with the temporary account:
    : *******************************
    : Hive:
    : HKEY_CURRENT_USERSoftwareMicrosoftWindowsCurrentVersion PoliciesExplorer
    :
    : Key:
    : RestrictRun = 1
    : *******************************
    : Hive:
    : HKEY_CURRENT_USERSoftwareMicrosoftWindowsCurrentVersion PoliciesExplorerRestrictRun
    :
    : Keys:
    : 1 = regedit.exe
    : 2 = notepad.exe
    : .... List the applications you want the user to be able to run.
    : *******************************
    :
    : Change the RestrictRun key to 0 if you want to disable the feature.
    : You have to reboot the computer each time you change anything though.
    :
    : This should be easy to implement in your app, either use IWshRuntimeLibrary.WshShell or do it with the Windows API.
    :
    : Cheers!
    :
    : [hr]
    :
    : [b][blue]//MicroDot[/blue][/b]
    :
    :
    Ohhhh, i suppose that would be a real good idea....i'm just starting to get the idea of how the registry is set up and how everything there works...as far as i know, there are some keys/Dwords etc. that are set to be handled by the registry, but aren't actually there yet...so people can add/remove keys as long as they know what key they're messing with..i really think i like playing with the registry because there's just so much that can be done! it looks like this is where the real powerful stuff is done if you know what you're doing...still a long way to go, but i appreciate all your help!

    i'll create a new user and play around with the registry in there...i hadn't realized that everything that can be done on HKLM can also be done on HKCU...not sure about the others, but it looks like these two will be where i need to do most of my changes.

    Thanks again everyone, if anyone else has tips/suggestions or anything about working with the registry i'm open :) i think i should have enough keys to change now that will accomplish what i need to but there may be some things i'm not thinking of.

    -Ryan

  • : [b][red]This message was edited by MicroDot at 2004-8-19 1:10:22[/red][/b][hr]
    : [b][red]This message was edited by MicroDot at 2004-8-19 1:9:7[/red][/b][hr]
    : Hi,
    : You can change a registry value to disable/enable the task manager without restarting the computer.
    :
    : Hive
    : ----
    : HKEY_CURRENT_USERSoftwareMicrosoftWindowsCurrentVersionPoliciesSystem
    :
    : Key
    : ---
    : DisableTaskMgr
    :
    : Values
    : ------
    : 1 = Disabled
    : 0 = Enabled
    :
    :
    : Try this:
    : Create a new project (Standard EXE)
    : Add Windows Script Host Object Model (wshom.ocx) to your refrences
    :
    : [code]
    :
    : Option Explicit
    :
    : Private m_objWS As IWshRuntimeLibrary.WshShell
    : Private m_blnDisabled As Boolean
    :
    : Private Const REG_HIVE = "HKEY_CURRENT_USERSoftwareMicrosoftWindowsCurrentVersionPoliciesSystem"
    : Private Const REG_KEY = "DisableTaskMgr"
    : Private Const REG_VALUE_DISABLE = 1
    : Private Const REG_VALUE_ENABLE = 0
    :
    : Private Sub Form_Load()
    : Set m_objWS = New IWshRuntimeLibrary.WshShell
    : Call LoadSettings
    : Call SetCaption
    : End Sub
    :
    : Private Sub LoadSettings()
    :
    : On Error GoTo LS_Err
    :
    : m_blnDisabled = m_objWS.RegRead(REG_HIVE & REG_KEY)
    :
    : Exit Sub
    :
    : LS_Err:
    : Call SetDefault
    : End Sub
    :
    : Private Sub SetDefault()
    : m_blnDisabled = True
    : Call m_objWS.RegWrite(REG_HIVE & REG_KEY, CInt(m_blnDisabled))
    : End Sub
    :
    : Private Sub SetCaption()
    : If m_blnDisabled Then
    : Command1.Caption = "Disable"
    : Else
    : Command1.Caption = "Enable"
    : End If
    : End Sub
    :
    : Private Sub Command1_Click()
    : m_blnDisabled = Abs(m_blnDisabled) - 1
    : Call m_objWS.RegWrite(REG_HIVE & REG_KEY, CInt(m_blnDisabled))
    : Call SetCaption
    : End Sub
    :
    : Private Sub Form_Unload(Cancel As Integer)
    : Set m_objWS = Nothing
    : End Sub
    :
    : [/code]
    :
    :
    : [hr]
    :
    : [b][blue]//MicroDot[/blue][/b]
    :
    :
    :
    :
    :
    :

    Hi microdot, i've tried the code you post but when i add wshom.ocx to my reference and click apply to the components window, a message window appear and say that wshom.ocx could not be loaded, what should i do??...

    BuB'

  • If you didn't know this already (you probably do, since you read a couple of articles but):
    HKEY_LOCAL_MACHINE - Settings for all users
    HKEY_CURRENT_USER - Settings for currently logged on user (the hive is loaded and saved from HKEY_USERS)
    HKEY_CLASSES_ROOT - Hive is loaded from HKEY_LOCAL_MACHINESoftwareClasses and from HKEY_CURRENT_USERSoftwareClasses. Always, CURRENT USER settings have priority over LOCAL MACHINE, and if you edit something when present the data in CURRENT USER will be changed, not in LOCAL MACHINE. If there is no such data in current user, then local machine will ofcourse be edited. I haven't really a clue where the data will be placed if you create a new key... it's easy to test though.
    I forgot what HKEY_CURRENT_CONFIG is exactly about. I do know it contains device (hardware) settings.

    Good luck and have fun, but don't screw yourself ;-)
    Richard
Sign In or Register to comment.

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Categories