Jump to content

Regread or some other command?


MariusN
 Share

Recommended Posts

The below code will display the Sring Value DATA that's in "Shell" --->

$read = RegRead("HKCU\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Winlogon\", "Shell")

MsgBox(0x10, "WARNING!!!",$read)

What i want to know is, how can i code to show if only the "Shell"-key exists? (i dont worry whats IN the shell, just want to know if "Shell" exists...

thx folks

Link to comment
Share on other sites

Tvern is Right

$_Var = RegRead ( "HKCU\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Winlogon\Shell", "" ) 
Switch @error
    case 1
        $_Msg  = 'Unable to open requested key'
    case 2
        $_Msg  = 'Unable to open requested main key'    
    case 3
        $_Msg  = 'Unable to remote connect to the registry' 
    case -1
        $_Msg  = 'Unable to open requested value'   
    case -2
        $_Msg  = 'Value type not supported' 
    case Else
        $_Msg  = $_Var  
EndSwitch   
    
ConsoleWrite ( "-->-- " & $_Msg & @Crlf )

if key exists but no value, it gives "Unable to open requested value"

if key not exists, it gives "Unable to open requested key" Posted Image

Edited by wakillon

AutoIt 3.3.14.2 X86 - SciTE 3.6.0WIN 8.1 X64 - Other Example Scripts

Link to comment
Share on other sites

Tvern is Right

$_Var = RegRead ( "HKCU\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Winlogon\Shell", "" ) 
Switch @error
    case 1
        $_Msg  = 'Unable to open requested key'
    case 2
        $_Msg  = 'Unable to open requested main key'    
    case 3
        $_Msg  = 'Unable to remote connect to the registry' 
    case -1
        $_Msg  = 'Unable to open requested value'   
    case -2
        $_Msg  = 'Value type not supported' 
    case Else
        $_Msg  = $_Var  
EndSwitch   
    
ConsoleWrite ( "-->-- " & $_Msg & @Crlf )

if key exists, it gives "Unable to open requested value"

if key not exists, it gives "Unable to open requested key" Posted Image

Geez....why didnt i think of that...thanks guys :graduated:
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...