Jump to content

Shell Changer


RichE
 Share

Recommended Posts

i've wrriten quite a few programs but was always reluctant to put them up as I'm not really a programmer by trade, One of my first programs is the shell changer, which i wrote as i cnovert pc's in terminals but don't want the students to have access to explorer, hence the two initial options just comment out the TS part, I'll post the TS.exe source up soon

anyway it maybe of use to someone.

Posted Image

#include <GuiConstants.au3>

Opt("GUIOnEventMode", 1)

GuiCreate("Shell Changer", 239, 156,(@DesktopWidth-239)/2, (@DesktopHeight-156)/2 , $WS_OVERLAPPEDWINDOW + $WS_VISIBLE + $WS_CLIPSIBLINGS)

GuiCtrlCreateGroup("Shell Changer", 10, 10, 220, 140)
$exp = GuiCtrlCreateRadio("Explorer", 20, 30, 200, 20)
GUICtrlSetState ($exp,$GUI_CHECKED)

$ts = GuiCtrlCreateRadio("Terminal Server", 20, 60, 200, 20)

$other = GuiCtrlCreateRadio("Other", 20, 90, 70, 20)
$other_Input = GuiCtrlCreateInput("browse", 90, 90, 110, 20)
$other_browse = GuiCtrlCreateButton("...", 200, 90, 20, 20)
GUICtrlSetOnEvent(-1, "obrowse")


$set = GuiCtrlCreateButton("Set", 20, 120, 90, 20)
GUICtrlSetOnEvent(-1, "set")


$cancel = GuiCtrlCreateButton("Cancel", 130, 120, 90, 20)
GUICtrlSetOnEvent(-1, "cancel")

GuiSetState()

    func obrowse()
    $obs = FileOpenDialog("Please select Executable file", "c:\", "Executables (*.exe)", 1+2)
    GUICtrlSetData($other_input, $obs, "")
    GUICtrlSetState ($other,$GUI_CHECKED)
    EndFunc


    Func cancel()
    Exit
    EndFunc

    Func set()
    $shell = RegRead("HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Winlogon\", "Shell")
        
    if GUICtrlRead($exp) = 1 then 
        if $shell = "explorer.exe" Then
            msgbox(64, "Information", "your shell is already set to explorer.exe", 10)
        Else
            RegWrite("HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Winlogon", "Shell", "REG_SZ", "explorer.exe")
            $shell1 = RegRead("HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Winlogon\", "Shell")
            msgbox(64, "Information", "The Shell has been changed from " & $shell & ", to " & $shell1, 10)
            msgbox(64,"information", "please exit the utility and reboot your machine for the changed to take effect", 10)
    
        EndIf
    EndIf
    
    if GUICtrlRead($ts) = 1 then 
        if $shell = "c:\ts.exe" Then
            msgbox(64, "Information", "your shell is already set for terminal server", 10)
        Else
            RegWrite("HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Winlogon", "Shell", "REG_SZ", "c:\ts.exe")
            $shell1 = RegRead("HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Winlogon\", "Shell")
            msgbox(64, "Information", "The Shell has been changed from " & $shell & ", to " & $shell1, 10)
            msgbox(64,"information", "please exit the utility and reboot your machine for the changed to take effect", 10)
    
        EndIf
    
    EndIf
    
    if GUICtrlRead($other) = 1 then 
        $select = GUICtrlRead($other_input)
        if $select = "browse" or "" Then
            msgbox(48, "Warning", "no executable files selected", 10)
            Else
        RegWrite("HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Winlogon", "Shell", "REG_SZ", $select)
        $shell1 = RegRead("HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Winlogon\", "Shell")
        msgbox(64, "Information", "The Shell has been changed from " & $shell & ", to " & $shell1, 10)
        msgbox(64,"information", "please exit the utility and reboot your machine for the changed to take effect", 10)
        EndIf
    EndIf
    
    EndFunc

While 1 
     Sleep ( 200 )
WEnd 
Exit
Edited by l15ard

RichE

[font="'Arial Narrow';"]Current projects[/font]

[font="'Arial Narrow';"]are on my site [/font]Sellostring

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...